Ticket #26977: 26977-test.diff

File 26977-test.diff, 1.5 KB (added by Tim Graham, 8 years ago)
  • tests/model_inheritance/models.py

    diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models.py
    index 45f22df..ef0cac1 100644
    a b class Post(models.Model):  
    5757@python_2_unicode_compatible
    5858class Attachment(models.Model):
    5959    post = models.ForeignKey(
    60         Post,
     60        'model_inheritance.Post',
    6161        models.CASCADE,
    6262        related_name='attached_%(class)s_set',
    6363        related_query_name='attached_%(app_label)s_%(class)ss',
  • tests/model_inheritance/tests.py

    diff --git a/tests/model_inheritance/tests.py b/tests/model_inheritance/tests.py
    index 7362c44..f7b2272 100644
    a b from django.test.utils import CaptureQueriesContext, isolate_apps  
    99from django.utils import six
    1010
    1111from .models import (
    12     Base, Chef, CommonInfo, GrandChild, GrandParent, ItalianRestaurant,
    13     MixinModel, ParkingLot, Place, Post, Restaurant, Student, SubBase,
    14     Supplier, Title, Worker,
     12    Attachment, Base, Chef, CommonInfo, GrandChild, GrandParent,
     13    ItalianRestaurant, MixinModel, ParkingLot, Place, Post, Restaurant,
     14    Student, SubBase, Supplier, Title, Worker,
    1515)
    1616
    1717
    1818class ModelInheritanceTests(TestCase):
     19    def test_instantiate_abstract(self):
     20        Attachment()
     21
    1922    def test_abstract(self):
    2023        # The Student and Worker models both have 'name' and 'age' fields on
    2124        # them and inherit the __str__() method, just as with normal Python
Back to Top