Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
check that update_cached_amounts actually updates the amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Sep 10, 2014
1 parent e990c09 commit 6d5ab04
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/py/test_billing_payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,23 @@ def check():
funded_tips = self.db.all("SELECT amount FROM tips WHERE is_funded ORDER BY id")
assert funded_tips == [3, 6, 4, 5]

# Pre-test check
check()

# Check that update_cached_amounts doesn't mess anything up
Payday.start().update_cached_amounts()
check()

# Check that update_cached_amounts actually updates amounts
self.db.run("""
UPDATE tips SET is_funded = false;
UPDATE participants
SET giving = 0
, npatrons = 0
, pledging = 0
, receiving = 0
, taking = 0;
""")
Payday.start().update_cached_amounts()
check()

Expand Down

0 comments on commit 6d5ab04

Please sign in to comment.