This commit is contained in:
Bastien Gerard 2021-09-30 20:39:44 +02:00
parent 558e3299fe
commit 28226f81a8

View File

@ -872,17 +872,15 @@ class TestQueryset(unittest.TestCase):
self.Person.objects.create(name="Foo", age=11)
bob = self.Person.objects.as_pymongo().first()
assert 'age' in bob
assert bob['age'] == 11
assert "age" in bob
assert bob["age"] == 11
self.Person.objects(name="Foo").update(
rename__age='person_age'
)
self.Person.objects(name="Foo").update(rename__age="person_age")
bob = self.Person.objects.as_pymongo().first()
assert 'age' not in bob
assert 'person_age' in bob
assert bob['person_age'] == 11
assert "age" not in bob
assert "person_age" in bob
assert bob["person_age"] == 11
def test_save_and_only_on_fields_with_default(self):
class Embed(EmbeddedDocument):