#27817: Jsonfield duplicating records in production database after running
manage.py test
------------------------------------------------+------------------------
               Reporter:  Christian Maillefaud  |          Owner:  nobody
                   Type:  Bug                   |         Status:  new
              Component:  Uncategorized         |        Version:  1.10
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 Model:

 {{{
 class PermissionTemplate(models.Model):
     site = models.ForeignKey(
         Site,
         verbose_name=_("site"),
         on_delete=models.CASCADE,
         related_name="%(app_label)s_%(class)s_site"
     )
     on_site = CurrentSiteManager()
     name = models.CharField(_("nome"), max_length=30)
     values = JSONField()
 }}}



 Code in TestCase:
 {{{
 class TestPermission(TestCase):
       self.site, created = Site.objects.get_or_create(
             defaults={
                 'domain': 'testserver'
             },
             id=settings.SITE_ID)
       self.permission_template, created = \
             PermissionTemplate.on_site.get_or_create(
                 site=self.site,
                 name='test_template',
                 defaults={
                     'values': {
                         'open_imovel': 1,
                         'named_imovel': 3,
                         'sharing': 0,
                         'owner_data': 0,
                         'aggrements': 0,
                         'users': 0,
                         'internal': True,
                         'default': True
                     }
                 }
             )
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27817>
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/054.d70af9b69ee205d85d61f30c1bf3d297%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to