#22462: Loading issue of models declared in tests.py due to a combination of
AdminConfig, System checks, and Model._meta caching.
---------------------------------+------------------------------------
     Reporter:  loic84           |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Core (Other)     |                  Version:  master
     Severity:  Release blocker  |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------

Comment (by prestontimmons):

 This might be a dumb idea, but what if test models could be specified with
 an attribute on the Meta class? For instance:

 {{{
 class TestModel(models.Model):

     class Meta:
         test = True
 }}}

 They could still live in models.py, to solve the app-loading issue, but
 only be synced when the test suite is running.

 This doesn't solve the use-cases in Django's test suite, where models are
 sometimes defined for the duration of a test method and cleared from the
 app cache, but it's good enough for any time I've used test models.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22462#comment:13>
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/064.de96982ad4483d3bee7227c4ab7dd405%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to