#7835: Provide the ability for model definitions that are only availably during
testing
-------------------------------------+------------------------------------
     Reporter:  russellm             |                    Owner:  kkubasik
         Type:  New feature          |                   Status:  new
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  feature test models  |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by danielsamuels):

 * cc: daniel.samuels1@… (added)


Comment:

 This functionality is still broken as of Django 1.7.7.  This is a very
 basic repro example:

 {{{#!python
 from django.db import models
 from django.test import TestCase


 class TestModel(models.Model):
     label = models.CharField(
         max_length=100,
     )


 class Test(TestCase):

     def setUp(self):
         TestModel.objects.create(
             label='X'
         )

 }}}

 Add this to any app as tests.py and run it, you will get an error like
 this:

 {{{
 django.db.utils.ProgrammingError: relation "media_testmodel" does not
 exist
 LINE 1: ...a_testmodel"."id", "media_testmodel"."label" FROM "media_tes...
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/7835#comment:39>
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.8b4a389aadf4e23443f6f14c54e2a17f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to