diff --git a/README.rst b/README.rst index 76f0bca..537a328 100644 --- a/README.rst +++ b/README.rst @@ -65,6 +65,8 @@ For now we only use sqlite One may use `make db_clean` and `make db_fill` to feed database. +For debugging purposes `watch make db_reset` and `make watch_db` might be helpful in aside terminals. + Toolings -------- diff --git a/database.py b/database.py index 6f57615..5242bd9 100644 --- a/database.py +++ b/database.py @@ -25,11 +25,15 @@ def fill_db(): import random def _genres(): - return random.choice(["Comedy"], ["Comedy", "Drama"], []) + return random.choice([["Comedy"], ["Comedy", "Drama"], []]) for _ in range(3): name = f"fill_db_{random.randint(1, 1000):03}" + out = crud.create_movie(SessionLocal(), title=name, genres=_genres()) + print(out.genres) + + print(out.genres.copy()) print(out.title) diff --git a/utests/test_api.py b/utests/test_api.py index 768f693..5c3d659 100644 --- a/utests/test_api.py +++ b/utests/test_api.py @@ -269,7 +269,6 @@ class ApiTestCase(unittest.TestCase): == be_the_fun_in_de_funes[attribute_name] ) - @unittest.expectedFailure def test_payload_content_in_and_out_loopback_non_primitive(self): be_the_fun_in_de_funes = { "id": 1, @@ -287,7 +286,6 @@ class ApiTestCase(unittest.TestCase): domain_keys = sorted( {k for k in be_the_fun_in_de_funes if k not in ["id"]} ) # Make it deterministic - non_primtive = ["genres", "release_date"] payload = {k: be_the_fun_in_de_funes[k] for k in domain_keys} response = client.post("/movies/", json=payload)