def test_view_list_given_slug(self): other_conf = ConferenceFactory() this_class = ClassFactory.create(accepted=3, e_conference=self.conf, b_conference=self.conf) that_class = ClassFactory.create(accepted=3, e_conference=other_conf, b_conference=other_conf) login_as(ProfileFactory(), self) url = reverse("event_list", urlconf="gbe.scheduling.urls", args=["Class"]) response = self.client.get( url, data={"conference": self.conf.conference_slug}) self.assertTrue(this_class.e_title in response.content) self.assertFalse(that_class.e_title in response.content)
def test_view_panels(self): this_class = ClassFactory.create(accepted=3, e_conference=self.conf, b_conference=self.conf, type="Panel") that_class = ClassFactory.create(accepted=3, e_conference=self.conf, b_conference=self.conf) login_as(ProfileFactory(), self) url = reverse("event_list", urlconf="gbe.scheduling.urls", args=["Panel"]) response = self.client.get( url, data={"conference": self.conf.conference_slug}) self.assertContains(response, this_class.e_title) self.assertNotContains(response, that_class.e_title) self.assertContains(response, this_class.teacher.name)
def test_view_volunteers(self): this_class = ClassFactory.create(accepted=3, e_conference=self.conf, b_conference=self.conf) generic_event = GenericEventFactory(e_conference=self.conf, type="Volunteer") login_as(ProfileFactory(), self) url = reverse("event_list", urlconf="gbe.scheduling.urls", args=["Volunteer"]) response = self.client.get( url, data={"conference": self.conf.conference_slug}) self.assertContains(response, generic_event.e_title) self.assertNotContains(response, this_class.e_title) self.assertNotContains(response, 'fa-star') self.assertNotContains(response, 'fa-star-o')
def test_view_volunteers(self): this_class = ClassFactory.create(accepted=3, e_conference=self.conf, b_conference=self.conf) staff_context = StaffAreaContext(conference=self.conf) opportunity = staff_context.add_volunteer_opp() opportunity.starttime = datetime.now() + timedelta(days=1) opportunity.save() login_as(ProfileFactory(), self) url = reverse("event_list", urlconf="gbe.scheduling.urls", args=["Volunteer"]) response = self.client.get( url, data={"conference": self.conf.conference_slug}) vol_link = reverse('set_volunteer', args=[opportunity.pk, 'on'], urlconf='gbe.scheduling.urls') self.assertContains(response, opportunity.eventitem.e_title) self.assertContains(response, vol_link) self.assertContains(response, 'volunteered.gif" class="volunteer-icon"') self.assertNotContains(response, this_class.e_title) self.assertNotContains(response, 'fa-star') self.assertNotContains(response, 'fa-star-o')