Hello everyone. I've seen several threads in the past months about
integrating Selenium into Django, so hopefully I'm not asking
something
that's already been asked.

I'm using OpenQA.org's Python RC client to communicate with a Selenium
server running in the background. I have a SeleniumTestCase class that
inherits from Python's unittest.TestCase class. In its setUp(), it
calls
start() on the RC client to initiate a session. Similarly in its
tearDown(), it calls stop().

The problem arises when running ./django-admin test. I have a
TestSuite
with several model tests (which run well) and several
SeleniumTestCase-based tests. However, I quickly realized that I'll
need
to spawn the Django development server from the test code somehow -
otherwise, the Selenium tests won't have anything to connect to.

At this point I'm stuck. My current code runs ./django-admin runserver
through the popen2 module. This has a major flaw, though: the
"runserver" process uses one database, but the initial ./django-admin
test process uses another database - one that it recreates and then
destroys every time it's used.

In other words, spawing a separate "runserver" process doesn't allow
me
to take advantage of Django's automatic testrunner code. I end up with
a
freshly created test database that's completely untouched by Selenium
tests AND the original database specified in settings.py (which
doesn't
get reset automatically).

I can't figure out how to use Django's management code to spawn a
runserver process without calling ./django-admin.py first. I also
can't
figure out how to resolve the double database issue. I've examined the
patch in #2879 and the explanations in #2867, but I've been unable to
recreate their steps.

Does anyone have any suggestions to point me in the right direction? I
apologize for the long email, and hopefully I'm not missing anything
fundamental.

Thank you!

Nick Fishman


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to