예제 #1
0
 def test_bank_account_not_asset_account(self):
     """Bank accounts must be asset accounts"""
     form = AccountForm(data=dict(name="Test Account",
                                  code="01",
                                  type="IN",
                                  is_bank_account="yes",
                                  currencies="GBP"))
     self.assertFalse(form.is_valid())
     error = form.errors["__all__"][0].lower()
     self.assertIn("bank account", error)
     self.assertIn("asset", error)
예제 #2
0
 def test_bank_account_single_currency(self):
     """Bank accounts may only have one currency"""
     form = AccountForm(data=dict(
         name='Test Account',
         code='01',
         type='AS',
         is_bank_account='yes',
         currencies='EUR, GBP',
     ))
     self.assertFalse(form.is_valid())
     error = form.errors['__all__'][0].lower()
     self.assertIn('bank account', error)
     self.assertIn('currency', error)
예제 #3
0
 def test_bank_account_not_asset_account(self):
     """Bank accounts must be asset accounts"""
     form = AccountForm(data=dict(
         name='Test Account',
         code='01',
         type='IN',
         is_bank_account='yes',
         currencies='GBP',
     ))
     self.assertFalse(form.is_valid())
     error = form.errors['__all__'][0].lower()
     self.assertIn('bank account', error)
     self.assertIn('asset', error)
예제 #4
0
 def test_bank_account_single_currency(self):
     """Bank accounts may only have one currency"""
     form = AccountForm(data=dict(
         name="Test Account",
         code="01",
         type="AS",
         is_bank_account="yes",
         currencies="EUR, GBP",
     ))
     self.assertFalse(form.is_valid())
     error = form.errors["__all__"][0].lower()
     self.assertIn("bank account", error)
     self.assertIn("currency", error)