I have django code that interacts with request objects or user objects. For example, for example:
foo_model_instance = models.get_or_create_foo_from_user(request.user)
If you were going to test python django shell or unittest, what would you go there? A User object will simply be created here, but often there is a need for a mock request object.
For shell or for unittests:
- How do you mock users?
- How do you mock requests?
python django unit-testing mocking
Purrell Jan 10 '10 at 5:20 2010-01-10 05:20
source share