comparison bio/tests/test_views.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 cd3343abca9d
children
comparison
equal deleted inserted replaced
788:84aa49497718 789:9e803323a0d0
195 195
196 u = User.objects.get(username='paul') 196 u = User.objects.get(username='paul')
197 self.assertEqual(u.first_name, 'Paul') 197 self.assertEqual(u.first_name, 'Paul')
198 self.assertEqual(u.last_name, 'Johnson') 198 self.assertEqual(u.last_name, 'Johnson')
199 self.assertEqual(u.email, 'pjmoto@example.com') 199 self.assertEqual(u.email, 'pjmoto@example.com')
200 profile = u.get_profile() 200 profile = u.profile
201 self.assertEqual(profile.occupation, 'Surf Guitar Pioneer') 201 self.assertEqual(profile.occupation, 'Surf Guitar Pioneer')
202 self.assertEqual(profile.profile_text, 'Wrote Mr. Moto at age 15.') 202 self.assertEqual(profile.profile_text, 'Wrote Mr. Moto at age 15.')
203 203
204 def test_avatar_change(self): 204 def test_avatar_change(self):
205 self.client.login(username='paul', password='pw') 205 self.client.login(username='paul', password='pw')
248 self.assertEqual(response.status_code, 200) 248 self.assertEqual(response.status_code, 200)
249 self.assertEqual(UserProfileFlag.objects.all().count(), 1) 249 self.assertEqual(UserProfileFlag.objects.all().count(), 1)
250 250
251 flag = UserProfileFlag.objects.first() 251 flag = UserProfileFlag.objects.first()
252 self.assertEqual(flag.user, paul) 252 self.assertEqual(flag.user, paul)
253 self.assertEqual(flag.profile, eddie.get_profile()) 253 self.assertEqual(flag.profile, eddie.profile)
254 254
255 self.assertEqual(len(mail.outbox), 1) 255 self.assertEqual(len(mail.outbox), 1)
256 self.assertTrue('A Profile Has Been Flagged' in mail.outbox[0].subject) 256 self.assertTrue('A Profile Has Been Flagged' in mail.outbox[0].subject)