def test_mysql_update_obj(indata):
    name = indata.name
    class_name = indata.__class__

    mysqldb().add_obj(indata)
    obj = mysqldb().query_obj_first(class_name, {"name": name})

    mysqldb().update_obj(obj, {"code": 1})

    obj = mysqldb().query_obj_first(class_name, {"name": name})
    assert obj.code == "1"
def test_mysql_query_None():
    obj = mysqldb().query_obj_first(models.CigmBu, {"name": "asdfasdfasdf"})
    assert obj is None
def test_mysql_query_obj(model, attrs):
    assert mysqldb().query_obj(model, attrs) is not None
def test_mysql_del_obj(indata):
    mysqldb().del_obj(indata)
def test_mysql_insert_objs(indata):
    try:
        mysqldb().add_obj(indata)
    except Exception:
        assert 0