Fix and re-enable AbstractModelTrackerTests

There used to be a [bug in Django](https://code.djangoproject.com/ticket/30427)
that caused these tests to fail, according to the discussion of #370.
That bug was fixed in Django 4.0.

However, because the test model was using a `FieldTracker`
rather than a `ModelTracker`, all model-specific test cases
in `ModelTrackerTests` continued to fail.
This commit is contained in:
Maarten ter Huurne 2024-06-12 16:36:14 +02:00
parent 324ea2bd25
commit a6b0a2aff7
2 changed files with 1 additions and 4 deletions

View file

@ -249,7 +249,7 @@ class TrackedAbstract(AbstractTracked):
number = models.IntegerField()
mutable = MutableField(default=None)
tracker = FieldTracker()
tracker = ModelTracker()
class TrackedNotDefault(models.Model):

View file

@ -1,7 +1,5 @@
from __future__ import annotations
from unittest import skip
from django.core.cache import cache
from django.core.exceptions import FieldError
from django.db import models
@ -877,7 +875,6 @@ class InheritedModelTrackerTests(ModelTrackerTests):
self.assertTrue(self.tracker.has_changed('name2'))
@skip("has known failures")
class AbstractModelTrackerTests(ModelTrackerTests):
tracked_class = TrackedAbstract