Refactoring & added all query

This commit is contained in:
2021-07-27 09:15:19 +02:00
parent a3fff9c7d7
commit 0f85d4b9bc
5 changed files with 28 additions and 5 deletions

View File

@@ -47,6 +47,18 @@ class QueryTest(unittest.TestCase):
self.assertTrue(res)
self.assertFalse(n_res)
def test_all(self):
results = []
for user in self._tests:
if user.address.nr == 10:
results.append(user)
res = self._tests.all(lambda u: u.address is not None)
n_res = self._tests.all(lambda u: u.address.nr == 100)
self.assertTrue(res)
self.assertFalse(n_res)
def test_first(self):
results = []
for user in self._tests: