Beispiel #1
0
def test_dict_to_model_deep(instance, result):
    """Test dict to model conversion recursive."""
    sqlalchemy.dict_to_model(instance, result)
    assert sqlalchemy.model_to_dict(instance, result.keys()) == result
Beispiel #2
0
def test_dict_to_model(model, result):
    """Test dict to model conversion."""
    instance = model(**dict(((key, '') for (key, value) in result.items())))
    sqlalchemy.dict_to_model(instance, result)
    assert instance._asdict() == result