Quantcast
Channel: Django UnitTest - Setting session variable - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by lmiguelvargasf for Django UnitTest - Setting session variable

If you are using pytest you can do the following:import pytestfrom django.test import Client@pytest.mark.django_db # this is used if you are using the databasedef test_my_tesst(): # code before setting...

View Article



Answer by aredzko for Django UnitTest - Setting session variable

That is generally what Client is for. It has access to the session data. I can't speak for django_webtest, since that's an outside library for django, but internally for unittesting, you can access and...

View Article

Django UnitTest - Setting session variable

I have a Django unit test class that is based on django_webtest.WebTest, and I can't find a proper way to set a session variable during the test. I have tried the following, but I don't work from...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>