python - CMSTestCase results in 'DatabaseWrapper' object has no attribute 'Database' -
i'm trying write simple tests factoryboy test app on django cms site. i'm using django 1.7.8 , django-cms 3.0.13 factory-boy 2.5.2
i setup test using unitest.testcase
changed cmstestcase
, under cms test case returns attributeerror: 'databasewrapper' object has no attribute 'database'
are different database settings required when running cmstestcase
? there's nothing unusual test;
from cms.test_utils.testcases import cmstestcase django.core.urlresolvers import reverse django.test import client django.test.utils import override_settings ...factories import eventfactory, entrantfactory class maxentranttest(cmstestcase): def setup(self): self.event = eventfactory.create() self.entrants = entrantfactory.create_batch(self.event.number_of_places) # every test needs client. self.client = client() @override_settings(root_urlconf='online_entry.tests.test_urls') def test_details(self): # issue request. response = self.client.get(reverse('online_entry:entry')) # check response 404 event full. self.assertequal(response.status_code, 404)
Comments
Post a Comment