#11593: Incomplete support for app-level testing
-------------------------------------+-------------------------------------
     Reporter:  Masklinn             |                    Owner:  Raphael
                                     |  Kimmig
         Type:  New feature          |                   Status:  assigned
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Raphael Kimmig):

 * owner:  nobody => Raphael Kimmig
 * status:  new => assigned


Comment:

 This ticket is really old, but I'd still love to see some progress here.
 I've been thinking about this a bit lately and below are my thoughts so
 far.
 We probably don't need to write a lot of code here, but rather add some
 documentation to the advanced tutorial as well as the advanced testing
 documentation.

 From what I can see there are a few common things that should be
 documented.

 1. How to run tests in a stand alone application (this requires settings).
 2. How to manage settings for running tests in a stand alone application.
 3. How to set up views/urls/middleware ... for tests.
 4. How to add models specifically for tests inside applications.


 For 1, 2 and 3. there are several solutions, to get started I'd probably
 describe
 how to use `django-admin test` to run the tests with a custom
 `test_settings.py`
 file.

 For 4. there is a simple solution if the app doesn't provide any models
 itself.
 In that case one can simply disable migrations for the app in the test
 settings.
 Ideally I'd like to try implementing a `@test_model` decorator as
 suggested in
 https://code.djangoproject.com/ticket/7835 which would also solve the
 general
 case.

 I'd love to have the documentation for reusable apps contain (directly, or
 via links
 to the testing docs) all the information required to not only create an
 app, but also
 make sure it has working tests.

 I'll try to expand the relevant docs over the next few days. If anyone has
 some
 input on the matter I'd be glad to hear it.

 Did I miss any obvious work in that area? Maybe even somewhere in the
 documentation?
 Do you have any suggestions on how specific aspects should be solved?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/11593#comment:9>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.44815b339550468f88741765c2df5fef%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to