Example #1
0
def execute_if_complete(pending_request):
    if pending_request.pendingverification_set.count():
        return False
    serializer = UpdateRequestSerializer(data=pending_request.request)
    serializer.is_valid(True)
    request = serializer.save()
    request.execute()
    pending_request.delete()
    return True
Example #2
0
def execute_if_complete(pending_request):
    if pending_request.pendingverification_set.count():
        return False
    serializer = UpdateRequestSerializer(data=pending_request.request)
    serializer.is_valid(True)
    request = serializer.save()
    request.execute()
    pending_request.delete()
    return True
Example #3
0
def test_single_item(simple_identity):
    request = {
        'identity': simple_identity,
        'items': [make_update_item('email', '*****@*****.**')]
    }
    serializer = UpdateRequestSerializer(data=request)
    assert serializer.is_valid(), serializer.errors
    update_request = serializer.save()
    assert len(update_request.items) == 1
    identity = update_request.identity
    assert identity.public_key == simple_identity['public_key']
    assert identity.drop_url == simple_identity['drop_url']
    assert identity.alias == simple_identity['alias']
    item = update_request.items[0]
    assert item.action == 'create'
    assert item.field == 'email'
    assert item.value == '*****@*****.**'