Charl P. Botha
unread,Aug 27, 2011, 7:21:49 AM8/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django: sane testing
Dear all,
I'm currently running into the following exception: "DatabaseError: no
such table: django_session" when I connect to the liveserver and try
to login to the test site during a test (see my TestSelenium below at
the raw_input()).
Which is strange, as I see the following in the captured logs:
django.db.backends: DEBUG: (0.000) CREATE TABLE "django_session" (
"session_key" varchar(40) NOT NULL PRIMARY KEY,
"session_data" text NOT NULL,
"expire_date" datetime NOT NULL
)
My invocation is as follows:
DJANGO_SETTINGS_MODULE=settings PYTHONPATH=. ~/build/tspy/bin/
nosetests --with-django --with-selenium --with-cherrypyliveserver
My test case looks as follows:
class TestSelenium(SeleniumTestCase):
def setUp(self):
# called before every test
super(TestSelenium, self).setUp()
self.u1 = User.objects.create(username='test',
password='test')
def test_ok(self):
self.selenium.open("/")
# check that the front page has correctly loaded and that the
user can login
self.assert_true(self.selenium.is_text_present("Login to
site"))
raw_input() # test waits here so I can connect to liveserver
def tearDown(self):
self.u1.delete()
Any help would be *greatly* appreciated. Eventually, I'd really like
to be able to exercise the full javascript-enabled site using
djangosanetesting and selenium!
Thanks,
Charl Botha