#2879: Add live test server support to test framework
-------------------------------------+-------------------------------------
     Reporter:  Mikeal Rogers        |                    Owner:  devin
  <mikeal@…>                         |                   Status:  new
         Type:  New feature          |                  Version:
    Component:  Testing framework    |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by tomchristie):

 Not sure, but you might need to add the new directories prior to applying
 the patch:

 {{{
 mkdir -p tests/regressiontests/live_server_tests/{media,static}
 }}}

 I'd missed out the example media and static file before - should be more
 clear now.
 So there's a test file in each of the `static` and `media` directories,
 and we'd expect them to serve from `/static/` and `/media/`.

 We're already making the implicit assumption that we want to serve static
 files, with the equivalent of:
 {{{
 urlpatterns += staticfiles_urlpatterns()
 }}}

 If `MEDIA_ROOT` is set, and `MEDIA_URL` is set to a relative URL, then we
 ought to also do the equivalent of:
 {{{
 urlpatterns += static(settings.MEDIA_URL,
 document_root=settings.MEDIA_ROOT)
 }}}

 (As it happens, I actually think Django's "use `settings.DEBUG` to
 determine if we should serve static/media files" is a slightly flawed in
 the first place, seeing as it's forced to `False` in testing.)

 I might take a look at seeing if I can adapt the implementation to be
 multi-process rather than multi-thread, and support on-disk sqlite
 databases.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/2879#comment:81>
Django <https://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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to