Example #1
0
 def test_class_draft_has_message(self):
     '''class_bid, not submitting and no other problems,
     should redirect to home'''
     msg = UserMessageFactory(view='MakeClassView', code='DRAFT_SUCCESS')
     response, data = self.post_class_edit_draft()
     self.assertEqual(200, response.status_code)
     assert_alert_exists(response, 'success', 'Success', msg.description)
 def test_update_profile_has_message(self):
     msg = UserMessageFactory(
         view='TroupeUpdate',
         code='SUCCESS')
     response, data = self.submit_troupe()
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
Example #3
0
 def test_clone_class_has_message(self):
     msg = UserMessageFactory(
         view='CloneBidView',
         code='CLONE_CLASS_SUCCESS')
     response, count, bid = self.clone_class()
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
Example #4
0
 def test_propose_submit_has_message(self):
     msg = UserMessageFactory(
         view='ProposeClassView',
         code='SUBMIT_SUCCESS')
     response = self.post_class_proposal()
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
Example #5
0
 def test_not_interested_at_all_make_message(self):
     msg = UserMessageFactory(
         view='MakeVolunteerView',
         code='NO_INTERESTS_SUBMITTED')
     response, context = self.edit_volunteer(rank=1)
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(
         response, 'danger', 'Error', msg.description)
Example #6
0
 def test_vendor_submit_has_message(self):
     msg = UserMessageFactory(
         view='MakeVendorView',
         code='SUBMIT_SUCCESS')
     response = self.post_edit_paid_vendor_submission()
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
Example #7
0
 def test_vendor_draft_has_message(self):
     msg = UserMessageFactory(
         view='MakeVendorView',
         code='DRAFT_SUCCESS')
     response = self.post_edit_paid_vendor_draft()
     self.assertEqual(200, response.status_code)
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
Example #8
0
 def test_volunteer_submit_has_message(self):
     msg = UserMessageFactory(
         view='MakeVolunteerView',
         code='EDIT_SUCCESS')
     response, context = self.edit_volunteer()
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(
         response, 'success', 'Success', msg.description)
    def test_update_profile_has_message(self, m_urlopen):
        msg = UserMessageFactory(view='EditProfileView', code='UPDATE_PROFILE')
        a = Mock()
        ok_email_filename = open("tests/gbe/forum_spam_response.xml", 'r')
        a.read.side_effect = [File(ok_email_filename).read()]
        m_urlopen.return_value = a

        response = self.post_profile()
        assert_alert_exists(response, 'success', 'Success', msg.description)
Example #10
0
 def test_not_interested_at_all_make_message(self):
     data = self.get_volunteer_form(submit=True)
     data['%d-rank' % self.interest.pk] = 1
     msg = UserMessageFactory(
         view='MakeVolunteerView',
         code='NO_INTERESTS_SUBMITTED')
     response, data = self.post_volunteer_submission(data)
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(
         response, 'danger', 'Error', msg.description)
Example #11
0
 def test_edit_act_title_collision_w_msg(self):
     message_string = "link: %s title: %s"
     msg = UserMessageFactory(view='MakeActView',
                              code='ACT_TITLE_CONFLICT',
                              description=message_string)
     response, original = self.post_title_collision()
     self.assertEqual(response.status_code, 200)
     error_msg = message_string % (reverse(
         'act_edit', urlconf='gbe.urls', args=[original.pk
                                               ]), original.b_title)
     assert_alert_exists(response, 'danger', 'Error', error_msg)
Example #12
0
 def test_no_interests_has_message(self):
     msg = UserMessageFactory(
         view='MakeVolunteerView',
         code='NO_BIDDING_ALLOWED')
     AvailableInterest.objects.all().delete()
     url = reverse(self.view_name,
                   urlconf='gbe.urls')
     login_as(self.profile, self)
     response = self.client.get(url, follow=True)
     self.assertRedirects(
         response,
         reverse('home', urlconf='gbe.urls'))
     assert_alert_exists(
         response, 'danger', 'Error', msg.description)
Example #13
0
 def test_act_bid_not_post(self):
     '''act_bid, not post, not paid should take us to bid process'''
     make_act_app_purchase(self.current_conference,
                           self.performer.performer_profile.user_object)
     msg = UserMessageFactory(view='MakeActView',
                              code='BID_INSTRUCTIONS',
                              summary="Act Bid Instructions",
                              description="Test Bid Instructions Message")
     login_as(self.performer.performer_profile, self)
     response = self.client.get(self.url)
     self.assertEqual(response.status_code, 200)
     self.assertContains(response, 'Propose an Act')
     self.assertNotContains(response, fee_instructions)
     self.assertContains(response, "Test Bid Instructions Message")
     self.assertContains(response, 'value="Submit For Approval"')
 def test_signup_w_approved_slot(self):
     UserMessage.objects.all().delete()
     msg = UserMessageFactory(view='VolunteerSignupView',
                              code='PENDING_INSTRUCTIONS')
     self.volunteeropp.approval_needed = True
     self.volunteeropp.save()
     self.staffcontext.book_volunteer(
         volunteer_sched_event=self.volunteeropp, volunteer=self.profile)
     login_as(self.profile, self)
     response = self.client.get(self.url)
     self.basic_event_check(response,
                            self.staffcontext.conference,
                            self.volunteeropp,
                            "approved.gif",
                            action="off")
     self.assertContains(response, msg.description)
 def test_signup_w_signed_up_slot(self):
     UserMessage.objects.all().delete()
     msg = UserMessageFactory(view='VolunteerSignupView',
                              code='VOLUNTEER_INSTRUCTIONS')
     self.staffcontext.book_volunteer(
         volunteer_sched_event=self.volunteeropp, volunteer=self.profile)
     login_as(self.profile, self)
     response = self.client.get(
         "%s?conference=%s" %
         (self.url, self.staffcontext.conference.conference_slug))
     self.basic_event_check(response,
                            self.staffcontext.conference,
                            self.volunteeropp,
                            "volunteered.gif",
                            action="off")
     self.assertContains(response, msg.description)
Example #16
0
 def test_edit_bid_get(self):
     '''edit_bid, not post, should take us to edit process'''
     msg = UserMessageFactory(view='MakeVendorView',
                              code='FEE_MESSAGE',
                              summary="Vendor Bid Instructions",
                              description="Test Fee Instructions Message")
     vendor = VendorFactory(business=self.business)
     tickets = setup_fees(vendor.b_conference, is_vendor=True)
     login_as(self.profile, self)
     url = reverse(self.view_name, urlconf='gbe.urls', args=[vendor.pk])
     response = self.client.get(url)
     self.assertEqual(response.status_code, 200)
     self.assertContains(response,
                         '<h2 class="gbe-title">Vendor Application</h2>',
                         html=True)
     self.assertContains(response, "Test Fee Instructions Message")
     self.assertContains(response, tickets[0].title)
     self.assertContains(response, tickets[1].cost)
Example #17
0
 def test_edit_business_has_message(self):
     msg = UserMessageFactory(view='BusinessUpdate', code='SUCCESS')
     response, new_name = self.submit_business()
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #18
0
 def test_edit_act_techinfo_has_message(self):
     msg = UserMessageFactory(view='EditActTechInfoView',
                              code='UPDATE_ACT_TECH')
     response, context, another = self.post_act_tech_info_success()
     self.assertEqual(response.status_code, 200)
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #19
0
 def test_edit_persona_has_message(self):
     msg = UserMessageFactory(view='EditPersonaView', code='UPDATE_PERSONA')
     response, new_name = self.submit_persona()
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #20
0
 def test_update_profile_has_message(self):
     msg = UserMessageFactory(view='UpdateProfileView',
                              code='UPDATE_PROFILE')
     response = self.post_profile()
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #21
0
 def test_create_persona_has_message(self):
     msg = UserMessageFactory(view='PersonaCreate', code='SUCCESS')
     response, persona_count = self.submit_persona()
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #22
0
 def test_create_persona_has_message(self):
     msg = UserMessageFactory(view='RegisterPersonaView',
                              code='CREATE_PERSONA')
     response, persona_count = self.submit_persona()
     assert_alert_exists(response, 'success', 'Success', msg.description)
Example #23
0
 def test_update_profile_has_message(self):
     msg = UserMessageFactory(view='EditTroupeView', code='UPDATE_TROUPE')
     response, data = self.submit_troupe()
     assert_alert_exists(response, 'success', 'Success', msg.description)