Add field option for fetch_from

This commit is contained in:
Ege Emir Özkan
2020-08-10 05:32:34 +03:00
parent 951623617c
commit 9cae63bfec
4 changed files with 17 additions and 13 deletions

View File

@@ -82,6 +82,10 @@ class DatabaseFetchCalls(unittest.TestCase):
t_obj = fetch_from(FetchClass, self.objs[0].obj_id)
self.assertEqual(self.objs[0], t_obj)
def testFetchFromDif(self):
t_obj = fetch_from(FetchClass, self.objs[0].str_, 'str_')
self.assertEqual(self.objs[0], t_obj)
def testFetchAll(self):
t_objs = fetch_all(FetchClass)
self.assertEqual(tuple(self.objs), t_objs)
@@ -97,5 +101,6 @@ class DatabaseFetchCalls(unittest.TestCase):
def tearDown(self) -> None:
[obj.remove_entry() for obj in self.objs]
if __name__ == '__main__':
unittest.main()