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