diff --git a/tests/select_related_onetoone/models.py b/tests/select_related_onetoone/models.py
index 9af1b3f..6b10666 100644
a
|
b
|
class Child3(Child2):
|
102 | 102 | |
103 | 103 | class Child4(Child1): |
104 | 104 | value4 = models.IntegerField() |
| 105 | |
| 106 | |
| 107 | class MyProduct(models.Model): |
| 108 | id = models.AutoField(primary_key=True) |
| 109 | price = models.IntegerField(db_column='price', default=0) |
| 110 | |
| 111 | class Meta: |
| 112 | db_table = 'product' |
| 113 | |
| 114 | class CurrentProduct(Product): |
| 115 | parent_product = models.OneToOneField(MyProduct, parent_link=True, related_name='current_product', db_column='parent') |
| 116 | price_test = models.IntegerField(default=0, db_column='price_frame') |
| 117 | |
| 118 | class Meta: |
| 119 | db_table = 'door' |
diff --git a/tests/select_related_onetoone/tests.py b/tests/select_related_onetoone/tests.py
index 92896b4..7130f88 100644
a
|
b
|
class ReverseSelectRelatedTestCase(TestCase):
|
208 | 208 | self.assertEqual(p.child1.name1, 'n1') |
209 | 209 | with self.assertNumQueries(1): |
210 | 210 | self.assertEqual(p.child1.child4.name1, 'n1') |
| 211 | |
| 212 | def test_product(self): |
| 213 | from .models import MyProduct, CurrentProduct |
| 214 | myproduct = MyProduct.objects.create(price=1) |
| 215 | CurrentProduct.objects.create(parent_product=myproduct, price_test=0) |
| 216 | products = MyProduct.objects.select_related('current_product').all() |
| 217 | self.assertEqual(products[0].current_product.price_test, 0) |