def test_handle_creates_the_expense(self, message, state):
        action = self.build_action(message, state)
        count = Expense.count()

        action.handle()

        assert Expense.count() == count + 1
Exemplo n.º 2
0
def test_notes_is_not_mandatory():
    assert Expense.count() == 0
    Expense(category='coca cola', amount=42).save()
    assert Expense.count() == 1
Exemplo n.º 3
0
def test_expense_is_created():
    assert Expense.count() == 0
    Expense(id='test_id', amount=42, category='coca cola',
            notes='Test notes').save()
    assert Expense.count() == 1
Exemplo n.º 4
0
def test_amount_is_not_mandatory():
    assert Expense.count() == 0
    Expense(category='coca cola', notes='test notes').save()
    assert Expense.count() == 1