def test_should_not_add_expense_given_invalid_expense_input_and_LUHP(self): self.login_user(self.dev_user) expense_input = dict(concept="Some Expense", type_id=self.expense_type.id, cost=10, unit="pz", quantity="") with self.client as client: client.post(url_for('expense.add'), data=expense_input) self.assertEqual(len(Expense.search_all('Some Expense')), 0)
def test_should_return_expense_given_valid_search_term(self): expenses = Expense.search_all(self.expense.concept) self.assertEqual(expenses, [self.expense])