Merge pull request #689 from Gluejar/fix-stripe-tests

Fix stripe tests again
pull/43/head
eshellman 2017-07-28 13:13:24 -04:00 committed by GitHub
commit 86b108364b
1 changed files with 5 additions and 4 deletions

View File

@ -272,7 +272,7 @@ class PledgingUiTests(TestCase):
class UnifiedCampaignTests(TestCase): class UnifiedCampaignTests(TestCase):
fixtures = ['initial_data.json','basic_campaign_test.json'] fixtures = ['initial_data.json','basic_campaign_test.json']
def test_setup(self): def verify_setup(self):
# testing basics: are there 3 users? # testing basics: are there 3 users?
self.assertEqual(User.objects.count(), 3) self.assertEqual(User.objects.count(), 3)
@ -289,7 +289,7 @@ class UnifiedCampaignTests(TestCase):
self.assertEqual(Work.objects.count(), 3) self.assertEqual(Work.objects.count(), 3)
self.assertEqual(Campaign.objects.count(), 2) self.assertEqual(Campaign.objects.count(), 2)
def test_junk_webhook(self): def do_test_junk_webhook(self):
"""send in junk json and then an event that doesn't exist""" """send in junk json and then an event that doesn't exist"""
# non-json # non-json
ipn_url = reverse("HandleIPN", args=('stripelib',)) ipn_url = reverse("HandleIPN", args=('stripelib',))
@ -456,12 +456,13 @@ class UnifiedCampaignTests(TestCase):
def test_good_bad_cc_scenarios(self): def test_good_bad_cc_scenarios(self):
num_prev_emails = len(mail.outbox) self.verify_setup()
self.do_test_junk_webhook()
self.good_cc_scenario() self.good_cc_scenario()
self.bad_cc_scenario() self.bad_cc_scenario()
self.recharge_with_new_card() self.recharge_with_new_card()
self.stripe_token_none() self.stripe_token_none()
self.assertEqual(len(mail.outbox), num_prev_emails + 8) self.assertEqual(len(mail.outbox), 9)
# expect these 6 notices : # expect these 6 notices :
# u'pledge_charged', <User: dataunbound>, # u'pledge_charged', <User: dataunbound>,