add relationship
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import app.events.reenroll_if_failed as app
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
|
||||
|
||||
def test_reenroll(
|
||||
@@ -27,3 +27,21 @@ 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',
|
||||
)
|
||||
)
|
||||
assert parent_entity['kind'] == 'CHILD'
|
||||
|
||||
child_entity = dynamodb_persistence_layer.collection.get_item(
|
||||
KeyPair(
|
||||
pk=parent_entity['enrollment_id'],
|
||||
sk='LINKED_ENTITIES#ENROLLMENT',
|
||||
)
|
||||
)
|
||||
|
||||
assert child_entity['enrollment_id'] == parent_entity['id']
|
||||
assert child_entity['kind'] == 'PARENT'
|
||||
|
||||
Reference in New Issue
Block a user