fix test
This commit is contained in:
@@ -8,10 +8,11 @@ def test_reenroll(
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
parent_id = '294e9864-8284-4287-b153-927b15d90900'
|
||||
event = {
|
||||
'detail': {
|
||||
'new_image': {
|
||||
'id': '294e9864-8284-4287-b153-927b15d90900',
|
||||
'id': parent_id,
|
||||
'sk': '0',
|
||||
'user': {
|
||||
'id': '2beb8642-aab4-4088-86d4-2966fac7c570',
|
||||
@@ -28,21 +29,20 @@ def test_reenroll(
|
||||
}
|
||||
assert app.lambda_handler(event, lambda_context) # type: ignore
|
||||
|
||||
parent_entity = dynamodb_persistence_layer.collection.get_item(
|
||||
KeyPair(
|
||||
pk='294e9864-8284-4287-b153-927b15d90900',
|
||||
sk='LINKED_ENTITIES#ENROLLMENT',
|
||||
)
|
||||
)
|
||||
# Parent knows the child
|
||||
assert parent_entity['kind'] == 'CHILD'
|
||||
|
||||
child_entity = dynamodb_persistence_layer.collection.get_item(
|
||||
KeyPair(
|
||||
pk=parent_entity['enrollment_id'],
|
||||
sk='LINKED_ENTITIES#ENROLLMENT',
|
||||
pk=parent_id,
|
||||
sk='LINKED_ENTITIES#ENROLLMENT#CHILD',
|
||||
)
|
||||
)
|
||||
assert child_entity
|
||||
|
||||
# Child knows the parent
|
||||
assert child_entity['enrollment_id'] == parent_entity['id']
|
||||
assert child_entity['kind'] == 'PARENT'
|
||||
parent_entity = dynamodb_persistence_layer.collection.get_item(
|
||||
KeyPair(
|
||||
pk=child_entity['enrollment_id'],
|
||||
sk='LINKED_ENTITIES#ENROLLMENT#PARENT',
|
||||
)
|
||||
)
|
||||
assert parent_entity['enrollment_id'] == parent_id
|
||||
|
||||
Reference in New Issue
Block a user