fix enrollment

This commit is contained in:
2025-05-30 20:27:00 -03:00
parent 47b3381108
commit 957f9c4a72
11 changed files with 76 additions and 35 deletions

View File

@@ -26,6 +26,7 @@ def test_enroll(
headers={'X-Tenant': 'cJtK9SsnJhKPyxESe7g3DG'},
body={
'items': [
# existing enrollment, must fail
{
'user': {
'id': '5OxmMjL-ujoR5IMGegQz',
@@ -37,9 +38,6 @@ def test_enroll(
'id': '6d69a34a-cefd-40aa-a89b-dceb694c3e61',
'name': 'pytest',
},
'deduplication_window': {
'offset_days': 60,
},
},
{
'user': {
@@ -52,6 +50,9 @@ def test_enroll(
'id': '6d69a34a-cefd-40aa-a89b-dceb694c3e61',
'name': 'pytest',
},
'deduplication_window': {
'offset_days': 60,
},
},
],
},
@@ -59,8 +60,13 @@ def test_enroll(
lambda_context,
)
# assert r['statusCode'] == HTTPStatus.OK
print(json.loads(r['body']))
assert r['statusCode'] == HTTPStatus.OK
fail, _ = json.loads(r['body'])
assert fail['cause'] == {
'type': 'DeduplicationConflictError',
'message': 'Enrollment already exists',
}
def test_vacancies(