Example #1
0
 def test_illegal_nested(self):
     m = DynamicModel(attrs={"nesty": {"level2": 1}})
     with pytest.raises(TypeError) as excinfo:
         m.save()
     assert "Key 'nesty.level2' should be of type " in str(excinfo.value)
Example #2
0
 def test_illegal_nested_type(self):
     m = DynamicModel(attrs={"nesty": []})
     with pytest.raises(TypeError) as excinfo:
         m.save()
     assert "Key 'nesty' should be of type dict" in str(excinfo.value)
Example #3
0
 def test_illegal_int(self):
     m = DynamicModel(attrs={"inty": 1.0})
     with pytest.raises(TypeError) as excinfo:
         m.save()
     assert "Key 'inty' should be of type int" in str(excinfo.value)