def test_edit_as_member(self): '''edit_troupe view, edit flow success ''' persona = PersonaFactory() troupe = TroupeFactory() troupe.membership.add(persona) troupe.save() url = reverse(self.view_name, args=[troupe.pk], urlconf='gbe.urls') login_as(persona.performer_profile.profile, self) response = self.client.get(url) self.assertRedirects( response, reverse('troupe_view', urlconf='gbe.urls', args=[str(troupe.pk)]))
def test_edit_as_member(self): '''edit_troupe view, edit flow success ''' persona = PersonaFactory() troupe = TroupeFactory() troupe.membership.add(persona) troupe.save() url = reverse(self.view_name, args=[troupe.pk], urlconf='gbe.urls') login_as(persona.performer_profile.profile, self) response = self.client.get(url) self.assertRedirects( response, reverse( 'troupe_view', urlconf='gbe.urls', args=[str(troupe.pk)]))
def test_view_troupe_as_member(self): '''view_troupe view, success ''' persona = PersonaFactory() member = PersonaFactory() contact = persona.performer_profile troupe = TroupeFactory(contact=contact) troupe.membership.add(member) troupe.save() url = reverse('troupe_view', args=[troupe.resourceitem_id], urlconf='gbe.urls') login_as(member.performer_profile.user_object, self) response = self.client.get(url) self.assertEqual(response.status_code, 200) self.assertContains(response, troupe.name) self.assertContains(response, troupe.contact.user_object.email) self.assertContains(response, member.name)