Django test mixins
The following are mixins we find ourselves using over and over again.
from test_mixins.assertions import AssertStatusMixin class SomeTestClass(AssertStatusMixin, TestCase): def some_test(self): response = self.client.get('some-url') self.assert403(response) # login response = self.client.get('some-url') self.assert200(response)
The following status codes are accounted for,
Used in conjunction with nose/django-nose,
lowers the South logging level to
logging.ERROR, so error output on
failing tests is more readable.
settings.py, add the following.
NOSE_PLUGINS = ['test_mixins.nose_plugins.SuppressSouth']