Skip to content

Commit

Permalink
Fix and re-enable AbstractModelTrackerTests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mthuurne committed Jun 12, 2024
1 parent 324ea2b commit a6b0a2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class TrackedAbstract(AbstractTracked):
number = models.IntegerField()
mutable = MutableField(default=None)

tracker = FieldTracker()
tracker = ModelTracker()


class TrackedNotDefault(models.Model):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_fields/test_field_tracker.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -877,7 +875,6 @@ def test_child_fields_not_tracked(self):
self.assertTrue(self.tracker.has_changed('name2'))


@skip("has known failures")
class AbstractModelTrackerTests(ModelTrackerTests):

tracked_class = TrackedAbstract
Expand Down

0 comments on commit a6b0a2a

Please sign in to comment.