def test_fixture_decorated_method_loads_models(): assert [] == Account.find_by_x(BasicAccounts.first.x) @BasicAccounts def some_method(): assert [BasicAccounts.first] == Account.find_by_x(BasicAccounts.first.x), "Wrong number of account loaded with x=%d: len=%d" % (BasicAccounts.first.x, len(Account.find_by_x(BasicAccounts.first.x))) some_method() assert [] == Account.find_by_x(BasicAccounts.first.x)
def test_fixture_decorated_method_unloads_models(): @BasicAccounts def some_method(): pass some_method() assert [] == Account.find_by_x(BasicAccounts.first.x)
def some_method(): assert [BasicAccounts.first] == Account.find_by_x(BasicAccounts.first.x), "Wrong number of account loaded with x=%d: len=%d" % (BasicAccounts.first.x, len(Account.find_by_x(BasicAccounts.first.x)))