def test_creation_with_good_signatures(factories, raw_signature, expected):
    serializer = SignatureSerializer(data={
        'text_signature': raw_signature,
    })
    assert serializer.is_valid(), serializer.errors
    signature = serializer.save()
    assert signature.text_signature == expected
def test_creation_with_good_signatures(factories, raw_signature, expected):
    serializer = SignatureSerializer(data={
        'text_signature': raw_signature,
    })
    assert serializer.is_valid(), serializer.errors
    signature = serializer.save()
    assert signature.text_signature == expected
def test_creation_with_bad_signatures(factories, bad_signature):
    serializer = SignatureSerializer(data={
        'text_signature': bad_signature,
    })
    assert not serializer.is_valid()
def test_creation_with_bad_signatures(factories, bad_signature):
    serializer = SignatureSerializer(data={
        'text_signature': bad_signature,
    })
    assert not serializer.is_valid()