def test_get_url_with_primary_key_in_document_and_a_single_document( controller: layabase.CRUDController, ): document = { "key": "first", "dict_field": {"first_key": "Value1", "second_key": 1}, "valid_since_revision": 1, "valid_until_revision": -1, } assert controller.get_url("/test", document) == "/test?key=first"
def test_get_url_with_primary_key_in_document_and_many_documents( controller: layabase.CRUDController, ): documents = [ { "key": "first", "dict_field": {"first_key": "Value1", "second_key": 1}, "valid_since_revision": 1, "valid_until_revision": -1, }, { "key": "second", "dict_field": {"first_key": "Value2", "second_key": 2}, "valid_since_revision": 1, "valid_until_revision": -1, }, ] assert controller.get_url("/test", *documents) == "/test?key=first&key=second"
def test_get_url_with_primary_key_in_document_and_no_document( controller: layabase.CRUDController, ): assert controller.get_url("/test") == "/test"