Esempio n. 1
0
 def test_from_unknow_id(self, mock_db):
     mock_db.__getitem__.return_value.find_one.return_value = None
     with pytest.raises(Document.DoesNotExist):
         Document.from_id('test')
Esempio n. 2
0
 def test_from_id(self, mock_db):
     test_dict = {'test': True}
     mock_db.__getitem__.return_value.find_one.return_value = test_dict
     doc = Document.from_id('test')
     assert isinstance(doc, Document)