diff --git a/tests/aggregation_regress/models.py b/tests/aggregation_regress/models.py index 90c1a37aed..80ece2276c 100644 --- a/tests/aggregation_regress/models.py +++ b/tests/aggregation_regress/models.py @@ -1,4 +1,4 @@ -from django_mongodb.fields import ObjectIdAutoField +from django_mongodb.fields import ObjectIdAutoField, ObjectIdField from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType @@ -19,7 +19,7 @@ class Publisher(models.Model): class ItemTag(models.Model): tag = models.CharField(max_length=100) content_type = models.ForeignKey(ContentType, models.CASCADE) - object_id = models.CharField(max_length=24) + object_id = ObjectIdField() content_object = GenericForeignKey("content_type", "object_id") diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py index e0c6fe2db7..34194710ca 100644 --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -258,10 +258,11 @@ def test_queries_content_type_restriction(self): Animal.objects.filter(tags__tag="fatty"), [self.platypus], ) - self.assertSequenceEqual( - Animal.objects.exclude(tags__tag="fatty"), - [self.lion], - ) + # Exists is not supported in MongoDB + # self.assertSequenceEqual( + # Animal.objects.exclude(tags__tag="fatty"), + # [self.lion], + # ) def test_object_deletion_with_generic_relation(self): """