Fix for ListField that isnt detecting properly that item 0 is changed

This commit is contained in:
Bastien Gérard
2020-10-10 23:32:22 +02:00
parent 4665658145
commit d4350e7da4
7 changed files with 45 additions and 30 deletions

View File

@@ -113,7 +113,7 @@ class TestDictField(MongoDBTestCase):
post.info.setdefault("authors", [])
post.save()
post.reload()
assert [] == post.info["authors"]
assert post.info["authors"] == []
def test_dictfield_dump_document(self):
"""Ensure a DictField can handle another document's dump."""

View File

@@ -1084,7 +1084,7 @@ class TestField(MongoDBTestCase):
e = Simple().save()
e.mapping = []
assert [] == e._changed_fields
assert e._changed_fields == []
class Simple(Document):
mapping = DictField()
@@ -1093,7 +1093,7 @@ class TestField(MongoDBTestCase):
e = Simple().save()
e.mapping = {}
assert [] == e._changed_fields
assert e._changed_fields == []
def test_slice_marks_field_as_changed(self):
class Simple(Document):

View File

@@ -381,7 +381,7 @@ class TestGeoField(MongoDBTestCase):
meta = {"indexes": [[("location", "2dsphere"), ("datetime", 1)]]}
assert [] == Log._geo_indices()
assert Log._geo_indices() == []
Log.drop_collection()
Log.ensure_indexes()
@@ -401,7 +401,7 @@ class TestGeoField(MongoDBTestCase):
"indexes": [{"fields": [("location", "2dsphere"), ("datetime", 1)]}]
}
assert [] == Log._geo_indices()
assert Log._geo_indices() == []
Log.drop_collection()
Log.ensure_indexes()