#23598: The testing framework has leaky scoping when defining models in tests
-----------------------------------+--------------------
Reporter: nalourie | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
If you define two subclasses of the models.Model class with the same name
in two different methods of a TestCase subclass, they should exist in
separate scopes and so be two completely distinct classes; however,
whichever test method is run first has it's model subclass definition
eclipse the others by the same name.
This bug occurs in Django 1.6, but in Django 1.7 this bug is avoided
because defining the model in two different scopes raises a RuntimeError
with a message along the lines of "RuntimeError: Conflicting 'class'
models in application 'test_bug'".
See attached example.
--
Ticket URL: <https://code.djangoproject.com/ticket/23598>
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/051.fc1a77102eb35c4955589584a9dacd56%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.