예제 #1
0
def test_base64_converter_to_python(url_val):
    assert base64_to_uuid(url_val) == UUID(int=1)
예제 #2
0
def test_base64_converter_to_python_raises_validation_error(url_val):
    with pytest.raises(Exception):
        base64_to_uuid(url_val)
예제 #3
0
 def to_python(self, value):
     try:
         return base64_to_uuid(value)
     except ValueError:
         raise ValidationError()