I wrote an example test, and I try to run it without creating a new database every time.
The first time I run my test, everything is fine (it was required sometime due to the creation of the database):
> REUSE_DB=1 python manage.py test contacts Ran 1 test in 0.251s
The second time I get the following error:
> REUSE_DB=1 python manage.py test contacts nosetests --verbosity 1 contacts AttributeError: 'DatabaseCreation' object has no attribute '_rollback_works'
Why and how can I decide? Thanks.
My test:
class ExampleTestCase(TestCase): def test_contact_page(self): resp = self.client.get('/contact/single/') self.assertEqual(resp.status_code, 200)
Settings.py
DEBUG = True TEMPLATE_DEBUG = DEBUG INSTALLED_APPS += ( 'django_nose', ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
Grantu
source share