Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
def test_fixture_decorated_method_unloads_models():
  @BasicAccounts
  def some_method(): pass
  some_method()
  assert [] == Account.find_by_x(BasicAccounts.first.x)
Ejemplo n.º 3
0
 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)))