コード例 #1
0
ファイル: test_common.py プロジェクト: andreyvit/funfix
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)
コード例 #2
0
ファイル: test_common.py プロジェクト: andreyvit/funfix
def test_fixture_decorated_method_unloads_models():
  @BasicAccounts
  def some_method(): pass
  some_method()
  assert [] == Account.find_by_x(BasicAccounts.first.x)
コード例 #3
0
ファイル: test_common.py プロジェクト: andreyvit/funfix
 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)))