Make mock library available for testing in Django
|Reported by:||Claude Paroz||Owned by:||Tim Graham|
|Cc:||Tim Graham||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Basically the main options are:
- Vendor the mock library backport in Django and conditionally import that backport (we used to have that for unittest2).
- Use a strategy similar to the
seleniumdependency, that is having a test class or a mixin class explicitly used when we are using
mockfunctionality in a test, and that class would skip the test when
mockis not available.
- Have the
mocklibrary as a hard dependency for our test suite, checking its availability in
runtests.pyfor Python < 3.3 with an appropriate message.