def test_add_summary(self): summary_instance = SummaryFactory(user=self.user) summary_instance.save() ms_object = ProfileUnits.objects.filter( content_type__name="summary").count() self.assertEqual(ms_object, 1)
def test_add_summary(self): summary_instance = SummaryFactory(user=self.user) summary_instance.save() ms_object = ProfileUnits.objects.filter( content_type__name="summary").count() self.assertEqual(ms_object, 1)
def test_handle_form_redirect_summary(self): """ When a user has a summary already if they try to make a new summary handle form should redirect the user to edit the summary they already have. User is only allowed one summary per account. """ summary_instance = SummaryFactory(user=self.user) summary_instance.save() resp = self.client.get(reverse('handle_form'), data={'module': 'Summary'}) self.assertRedirects(resp, reverse( 'handle_form')+'?id=%s&module=Summary' % summary_instance.id)
def test_handle_form_redirect_summary(self): """ When a user has a summary already if they try to make a new summary handle form should redirect the user to edit the summary they already have. User is only allowed one summary per account. """ summary_instance = SummaryFactory(user=self.user) summary_instance.save() resp = self.client.get(reverse('handle_form'), data={'module': 'Summary'}) self.assertRedirects( resp, reverse('handle_form') + '?id=%s&module=Summary' % summary_instance.id)