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)
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)
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)
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)