#2879: [patch] Add live test server support to test framework
--------------------------------------------------------+-------------------
   Reporter:  Mikeal Rogers <[EMAIL PROTECTED]>  |                Owner:  
nobody          
     Status:  reopened                                  |            Component: 
 Unit test system
    Version:                                            |           Resolution: 
                 
   Keywords:                                            |                Stage: 
 Accepted        
  Has_patch:  1                                         |           Needs_docs: 
 1               
Needs_tests:  1                                         |   Needs_better_patch: 
 1               
--------------------------------------------------------+-------------------
Comment (by Denis Golomazov <[EMAIL PROTECTED]>):

 Well, the last patch seems not to work in current trunk version. The
 structure of django/core has changed, and I see no obvious way of
 implementing the patch.

 I've created my own patch which seems to do the job. At least it works for
 me. Probably you'll need Python 2.5 to run it and, of course, Linux (since
 the fork() method is not implemented in Windows, as I believe). I tested
 it only with SQLite and really don't know if it'll work with other
 backends.

 The patch does a simple thing: after initializing environment and creating
 a test database, it forks and in child process a Django server is started.
 Being a child, it inherits the environment. In parent process, a test is
 started (which can include both Django !TestCase and Selenium methods),
 and when it finishes the child is killed and the parent returns the
 result. The patch consists of two files, one for django/test/simple.py and
 another for django/test/utils.py.

 One little thing to mention: I couldn't manage to make this idea work when
 I used :memory: database (which is default for SQLite in tests), thus I
 changed it to file. Then it worked.

 Using this method you probably will not have to use testserver (see
 [5912]).

 Any comments would be much appreciated.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2879#comment:24>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to