mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #13206 -- call super().__init__() in Model.__init__ to allow mixins to do things there.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -4,7 +4,7 @@ from django.core.exceptions import FieldError
|
||||
from django.test import TestCase
|
||||
|
||||
from models import (Chef, CommonInfo, ItalianRestaurant, ParkingLot, Place,
|
||||
Post, Restaurant, Student, StudentWorker, Supplier, Worker)
|
||||
Post, Restaurant, Student, StudentWorker, Supplier, Worker, MixinModel)
|
||||
|
||||
|
||||
class ModelInheritanceTests(TestCase):
|
||||
@@ -269,3 +269,7 @@ class ModelInheritanceTests(TestCase):
|
||||
self.assertNumQueries(1,
|
||||
lambda: ItalianRestaurant.objects.select_related("chef")[0].chef
|
||||
)
|
||||
|
||||
def test_mixin_init(self):
|
||||
m = MixinModel()
|
||||
self.assertEqual(m.other_attr, 1)
|
||||
|
||||
Reference in New Issue
Block a user