Exemplo n.º 1
0
def test_valid_name(val, expected):
    assert Environment.is_valid_name(val) == expected
Exemplo n.º 2
0
 def validate_environment(self, attrs, source):
     value = attrs[source]
     if not Environment.is_valid_name(value):
         raise serializers.ValidationError('Invalid value for environment')
     return attrs
Exemplo n.º 3
0
 def validate_environment(self, value):
     if not Environment.is_valid_name(value):
         raise serializers.ValidationError("Invalid value for environment")
     return value
Exemplo n.º 4
0
def test_valid_name(val, expected):
    assert Environment.is_valid_name(val) == expected
Exemplo n.º 5
0
 def validate_environment(self, attrs, source):
     value = attrs[source]
     if not Environment.is_valid_name(value):
         raise serializers.ValidationError('Invalid value for environment')
     return attrs