From 4a566e2faf070756e3eb68f642f396acb7458a7b Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 23 Nov 2016 21:26:19 -0500 Subject: [PATCH] Failing test for #3975 regression --- tests/py/test_db_checks.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/py/test_db_checks.py diff --git a/tests/py/test_db_checks.py b/tests/py/test_db_checks.py new file mode 100644 index 0000000000..527552723e --- /dev/null +++ b/tests/py/test_db_checks.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from gratipay import models +from gratipay.testing import Harness + + +class Tests(Harness): + + # cb - _check_balances - calls assert so we don't need asserts here + + def test_cb_is_fine_with_empty_database(self): + with self.db.get_cursor() as cursor: + models._check_balances(cursor) + + def test_cb_is_fine_with_status_unknown(self): + alice = self.make_participant('alice', balance=49) + self.make_exchange('braintree-cc', 49, 0, alice, status='unknown') + with self.db.get_cursor() as cursor: + models._check_balances(cursor)