comparison donations/tests.py @ 789:9e803323a0d0

Removing AUTH_PROFILE_MODULE and get_profile().
author Brian Neal <bgneal@gmail.com>
date Fri, 23 May 2014 15:10:11 -0500
parents 85880b0df024
children
comparison
equal deleted inserted replaced
788:84aa49497718 789:9e803323a0d0
64 self.assertEqual(d.payer_status, 'verified') 64 self.assertEqual(d.payer_status, 'verified')
65 self.assertEqual(d.payment_date, 65 self.assertEqual(d.payment_date,
66 datetime.datetime(2011, 1, 21, 4, 14, 8)) 66 datetime.datetime(2011, 1, 21, 4, 14, 8))
67 67
68 # user should have got a badge for donating 68 # user should have got a badge for donating
69 p = user.get_profile() 69 p = user.profile
70 badges = list(p.badges.all()) 70 badges = list(p.badges.all())
71 self.assertEqual(len(badges), 1) 71 self.assertEqual(len(badges), 1)
72 if len(badges) == 1: 72 if len(badges) == 1:
73 self.assertEqual(badges[0].numeric_id, bio.badges.CONTRIBUTOR_PIN) 73 self.assertEqual(badges[0].numeric_id, bio.badges.CONTRIBUTOR_PIN)
74 74
105 self.assertEqual(d.payer_status, 'unverified') 105 self.assertEqual(d.payer_status, 'unverified')
106 self.assertEqual(d.payment_date, 106 self.assertEqual(d.payment_date,
107 datetime.datetime(2011, 1, 16, 5, 40, 33)) 107 datetime.datetime(2011, 1, 16, 5, 40, 33))
108 108
109 # user should not have got a badge for donating 109 # user should not have got a badge for donating
110 p = user.get_profile() 110 p = user.profile
111 self.assertEqual(p.badges.count(), 0) 111 self.assertEqual(p.badges.count(), 0)
112 112
113 113
114 class DonationsManagerTestCase(TestCase): 114 class DonationsManagerTestCase(TestCase):
115 fixtures = ['donations_test'] 115 fixtures = ['donations_test']