diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models.py
index 3245c71..650a6a3 100644
a
|
b
|
class Base(models.Model):
|
186 | 186 | |
187 | 187 | class SubBase(Base): |
188 | 188 | sub_id = models.IntegerField(primary_key=True) |
| 189 | |
| 190 | |
| 191 | # auto_now_add/auto_now in abstract model |
| 192 | class Timestamps(models.Model): |
| 193 | created = models.DateTimeField(auto_now_add=True) |
| 194 | updated = models.DateTimeField(auto_now=True) |
| 195 | |
| 196 | class Meta: |
| 197 | abstract = True |
| 198 | |
| 199 | |
| 200 | class Product(Timestamps): |
| 201 | name = models.CharField(max_length=100, primary_key=True) |
diff --git a/tests/model_inheritance/test_auto_now.py b/tests/model_inheritance/test_auto_now.py
new file mode 100644
index 0000000..886391a
-
|
+
|
|
| 1 | from django.test import TestCase |
| 2 | |
| 3 | from .models import Product |
| 4 | |
| 5 | |
| 6 | class TestAutoNow(TestCase): |
| 7 | def test_model_save(self): |
| 8 | Product(name='foo').save() |
| 9 | Product(name='foo').save() |