Skip to content
Snippets Groups Projects

GREG-25: Adding namespace versioning

Merged Tore.Brede requested to merge GREG-25_add_api_versioning into master
3 files
+ 24
11
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -212,7 +212,8 @@ def test_identity_add(client, person_foo):
@@ -212,7 +212,8 @@ def test_identity_add(client, person_foo):
"value": "12345",
"value": "12345",
}
}
client.post(
client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}),
 
data=data,
)
)
response = client.get(
response = client.get(
@@ -230,7 +231,8 @@ def test_identity_add_duplicate(client, person_foo, person_bar):
@@ -230,7 +231,8 @@ def test_identity_add_duplicate(client, person_foo, person_bar):
"value": "12345",
"value": "12345",
}
}
client.post(
client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_bar.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_bar.id}),
 
data=data,
)
)
with pytest.raises(ValidationError):
with pytest.raises(ValidationError):
@@ -248,11 +250,13 @@ def test_identity_add_valid_duplicate(client, person_foo, person_bar):
@@ -248,11 +250,13 @@ def test_identity_add_valid_duplicate(client, person_foo, person_bar):
"value": "12345",
"value": "12345",
}
}
client.post(
client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_bar.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_bar.id}),
 
data=data,
)
)
client.post(
client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}),
 
data=data,
)
)
@@ -270,7 +274,8 @@ def test_identity_delete(client, person_foo):
@@ -270,7 +274,8 @@ def test_identity_delete(client, person_foo):
"value": "12345",
"value": "12345",
}
}
post_response = client.post(
post_response = client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}),
 
data=data,
)
)
identity_id = post_response.json()["id"]
identity_id = post_response.json()["id"]
@@ -281,7 +286,8 @@ def test_identity_delete(client, person_foo):
@@ -281,7 +286,8 @@ def test_identity_delete(client, person_foo):
"value": "1234413241235",
"value": "1234413241235",
}
}
post_response2 = client.post(
post_response2 = client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}),
 
data=data,
)
)
identity_id2 = post_response2.json()["id"]
identity_id2 = post_response2.json()["id"]
@@ -323,7 +329,8 @@ def test_identity_update(client, person_foo):
@@ -323,7 +329,8 @@ def test_identity_update(client, person_foo):
"value": "12345",
"value": "12345",
}
}
client.post(
client.post(
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}), data=data
reverse("v1:person_identity-list", kwargs={"person_id": person_foo.id}),
 
data=data,
)
)
response = client.get(
response = client.get(
Loading