#33422: Document @isolate_apps
-------------------------------------+-------------------------------------
     Reporter:  Adam Johnson         |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Testing framework    |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 > Is there a good way to create an isolated model class for a test without
 isolated_apps? It seems like a common enough problem when making custom
 model classes, fields, or similar.

 You can use the undocumented `Model.Meta.apps` option to point to a
 dedicated `Apps` instance, some tests do it when defining models at the
 module level, but it involves a lot of boilerplate and is easy to forget
 that you're polluting the main registry hence why `isolated_apps` is
 useful.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33422#comment:3>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.943cf2cb2d176998d579d4ede717b0d3%40djangoproject.com.

Reply via email to