Пример #1
0
 def test_good_json(self):
     input = '{"a": "b"}'
     result = validate_hstore(input)
     assert result == {u'a': u'b'}
Пример #2
0
 def test_empty_hstore_field(self):
     inputs = ('', None, {})
     for input in inputs:
         result = validate_hstore(input)
         assert result == {}
Пример #3
0
 def test_non_dict(self):
     inputs = ((), [], 0)
     for input in inputs:
         with pytest.raises(ValidationError):
             validate_hstore(input)
Пример #4
0
 def to_python(self, value):
     return validators.validate_hstore(value)