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