Ensure that a document may be saved in the database.
(self)
| 1020 | ] == ["lorem", "ipsum"] |
| 1021 | |
| 1022 | def test_save(self): |
| 1023 | """Ensure that a document may be saved in the database.""" |
| 1024 | |
| 1025 | # Create person object and save it to the database |
| 1026 | person = self.Person(name="Test User", age=30) |
| 1027 | person.save() |
| 1028 | |
| 1029 | # Ensure that the object is in the database |
| 1030 | raw_doc = get_as_pymongo(person) |
| 1031 | assert raw_doc == { |
| 1032 | "_cls": "Person", |
| 1033 | "name": "Test User", |
| 1034 | "age": 30, |
| 1035 | "_id": person.id, |
| 1036 | } |
| 1037 | |
| 1038 | def test_save_write_concern(self): |
| 1039 | class Recipient(Document): |
nothing calls this directly
no test coverage detected