Ticket #30330: test-30330.diff

File test-30330.diff, 1.1 KB (added by Mariusz Felisiak, 6 years ago)

Regression test.

  • tests/delete/models.py

    diff --git a/tests/delete/models.py b/tests/delete/models.py
    index 2fc5ebe217..70a0de62ab 100644
    a b  
    11from django.db import models
    22
    33
     4class Ticket30333(models.Model):
     5    name = models.CharField(max_length=100)
     6
     7
    48class R(models.Model):
    59    is_default = models.BooleanField(default=False)
    610
  • tests/delete/tests.py

    diff --git a/tests/delete/tests.py b/tests/delete/tests.py
    index 55eeb226ea..8937dd8079 100644
    a b from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature  
    77from .models import (
    88    MR, A, Avatar, Base, Child, HiddenUser, HiddenUserProfile, M, M2MFrom,
    99    M2MTo, MRNull, Parent, R, RChild, S, T, User, create_a, get_default_r,
     10    Ticket30333,
    1011)
    1112
    1213
    class OnDeleteTests(TestCase):  
    1415    def setUp(self):
    1516        self.DEFAULT = get_default_r()
    1617
     18    def test_30330(self):
     19        r = Ticket30333.objects.create(name='test')
     20        r.delete()
     21        self.assertEqual(r.pk, None)
     22
    1723    def test_auto(self):
    1824        a = create_a('auto')
    1925        a.auto.delete()
Back to Top