本文整理汇总了Python中tests.functions.gbe_functions.assert_alert_exists函数的典型用法代码示例。如果您正苦于以下问题:Python assert_alert_exists函数的具体用法?Python assert_alert_exists怎么用?Python assert_alert_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assert_alert_exists函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_clone_class_has_message
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)
示例2: test_copy_only_parent_event
def test_copy_only_parent_event(self):
another_day = ConferenceDayFactory()
show_context = VolunteerContext()
url = reverse(
self.view_name,
args=[show_context.sched_event.pk],
urlconf='gbe.scheduling.urls')
data = {
'copy_mode': 'include_parent',
'copy_to_day': another_day.pk,
'pick_event': "Finish",
}
login_as(self.privileged_user, self)
response = self.client.post(url, data=data, follow=True)
max_pk = Event.objects.latest('pk').pk
redirect_url = "%s?%s-day=%d&filter=Filter&new=[%sL]" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[another_day.conference.conference_slug]),
another_day.conference.conference_slug,
another_day.pk,
str(max_pk),)
self.assertRedirects(response, redirect_url)
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s' % (
show_context.event.e_title,
datetime.combine(
another_day.day,
show_context.sched_event.starttime.time()).strftime(
DATETIME_FORMAT)))
self.assertContains(response, "Occurrence has been updated.<br>", 1)
示例3: test_copy_child_event
def test_copy_child_event(self):
show_context = VolunteerContext()
target_context = ShowContext()
url = reverse(
self.view_name,
args=[show_context.sched_event.pk],
urlconf='gbe.scheduling.urls')
data = {
'copy_mode': 'copy_children_only',
'target_event': target_context.sched_event.pk,
'copied_event': show_context.opp_event.pk,
'pick_event': "Finish",
}
login_as(self.privileged_user, self)
response = self.client.post(url, data=data, follow=True)
max_pk = Event.objects.latest('pk').pk
redirect_url = "%s?%s-day=%d&filter=Filter&new=%s" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[target_context.conference.conference_slug]),
target_context.conference.conference_slug,
target_context.days[0].pk,
str([max_pk]),)
self.assertRedirects(response, redirect_url)
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s' % (
show_context.opportunity.e_title,
datetime.combine(
target_context.days[0].day,
show_context.opp_event.starttime.time()).strftime(
DATETIME_FORMAT)))
示例4: test_copy_single_event
def test_copy_single_event(self):
another_day = ConferenceDayFactory(
conference=self.context.conference,
day=self.context.conf_day.day + timedelta(days=1))
data = {
'copy_to_day': another_day.pk,
'pick_mode': "Next",
}
login_as(self.privileged_user, self)
self.url = reverse(
self.view_name,
args=[self.context.opp_event.pk],
urlconf='gbe.scheduling.urls')
response = self.client.post(self.url, data=data, follow=True)
max_pk = Event.objects.latest('pk').pk
redirect_url = "%s?%s-day=%d&filter=Filter&new=%s" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[another_day.conference.conference_slug]),
another_day.conference.conference_slug,
another_day.pk,
str([max_pk]),)
self.assertRedirects(response, redirect_url)
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s' % (
self.context.opportunity.e_title,
datetime.combine(
another_day.day,
self.context.opp_event.starttime.time()).strftime(
DATETIME_FORMAT)))
示例5: test_edit_persona_has_message
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)
示例6: test_not_interested_at_all
def test_not_interested_at_all(self):
data = self.get_volunteer_form(submit=True)
data['%d-rank' % self.interest.pk] = 1
response, data = self.post_volunteer_submission(data)
self.assertEqual(response.status_code, 200)
assert_alert_exists(
response, 'danger', 'Error', default_volunteer_no_interest_msg)
示例7: test_edit_event_and_continue
def test_edit_event_and_continue(self):
grant_privilege(self.privileged_user, 'Volunteer Coordinator')
login_as(self.privileged_user, self)
data = self.edit_event()
data['edit_event'] = "Save and Continue"
response = self.client.post(
self.url,
data=data,
follow=True)
self.assertRedirects(
response,
"%s?volunteer_open=True" % self.url)
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s 11:00 AM' % (
data['e_title'],
self.extra_day.day.strftime(DATE_FORMAT))
)
self.assertContains(response, data['e_title'])
self.assertContains(response, data['e_description'])
self.assertContains(
response,
'<option value="%d" selected="selected">%s</option>' % (
self.extra_day.pk,
self.extra_day.day.strftime(DATE_FORMAT)))
self.assertContains(response,
'name="max_volunteer" type="number" value="3" />')
self.assertContains(
response,
'name="duration" step="any" type="number" value="2.5" />')
示例8: test_set_ticket
def test_set_ticket(self):
grant_privilege(self.privileged_user, 'Ticketing - Admin')
bpt_event = BrownPaperEventsFactory(
conference=self.current_conference)
login_as(self.privileged_user, self)
data = self.edit_class()
data['bpt_events'] = bpt_event.pk
response = self.client.post(
self.url,
data=data,
follow=True)
new_class = GenericEvent.objects.get(e_title=data['e_title'])
self.assertEqual(new_class.type, "Master")
occurrence = Event.objects.get(
eventitem__eventitem_id=new_class.eventitem_id)
self.assertRedirects(
response,
"%s?%s-day=%d&filter=Filter&new=[%dL]" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[self.current_conference.conference_slug]),
self.current_conference.conference_slug,
self.day.pk,
occurrence.pk))
assert_alert_exists(
response,
'success',
'Success',
link_event_to_ticket_success_msg + '%s - %s, ' % (
bpt_event.bpt_event_id,
bpt_event.title)
)
示例9: test_create_persona_has_message
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)
示例10: test_class_draft_make_message
def test_class_draft_make_message(self):
'''class_bid, not submitting and no other problems,
should redirect to home'''
response, data = self.post_class_edit_draft()
self.assertEqual(200, response.status_code)
assert_alert_exists(
response, 'success', 'Success', default_class_draft_msg)
示例11: test_create_master
def test_create_master(self):
login_as(self.privileged_user, self)
data = self.edit_class()
response = self.client.post(
self.url,
data=data,
follow=True)
new_class = GenericEvent.objects.get(e_title=data['e_title'])
self.assertEqual(new_class.type, "Master")
occurrence = Event.objects.get(
eventitem__eventitem_id=new_class.eventitem_id)
self.assertRedirects(
response,
"%s?%s-day=%d&filter=Filter&new=[%dL]" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[self.current_conference.conference_slug]),
self.current_conference.conference_slug,
self.day.pk,
occurrence.pk))
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s 11:00 AM' % (
data['e_title'],
self.day.day.strftime(DATE_FORMAT))
)
self.assertContains(
response,
'<tr class="bid-table success">\n ' +
'<td class="bid-table">%s</td>' % data['e_title'])
示例12: test_copy_only_parent_event
def test_copy_only_parent_event(self):
another_day = ConferenceDayFactory()
data = {
'copy_mode': 'include_parent',
'copy_to_day': another_day.pk,
'pick_event': "Finish",
}
login_as(self.privileged_user, self)
response = self.client.post(self.url, data=data, follow=True)
max_area = StaffArea.objects.latest('pk')
redirect_url = "%s?%s-day=%d&filter=Filter&alt_id=%s" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[another_day.conference.conference_slug]),
another_day.conference.conference_slug,
another_day.pk,
max_area.pk,)
self.assertRedirects(response, redirect_url)
self.assertRedirects(response, redirect_url)
assert_alert_exists(
response,
'success',
'Success',
'A new Staff Area was created.<br>Staff Area: %s' % (
max_area.title))
示例13: test_set_eval
def test_set_eval(self):
q1 = EventEvalQuestionFactory(answer_type="grade")
q2 = EventEvalQuestionFactory(answer_type="text")
q3 = EventEvalQuestionFactory(answer_type="boolean")
login_as(self.profile, self)
response = self.client.post(
self.url,
data={
'question%d' % self.q0.pk: "A",
'question%d' % q1.pk: "B",
'question%d' % q2.pk: "This is Test Text.",
'question%d' % q3.pk: True,
},
follow=True)
assert_alert_exists(
response,
'info',
'Info',
eval_success_msg)
self.assertEqual(
2,
EventEvalGrade.objects.filter(
event=self.context.sched_event).count())
self.assertEqual(
1,
EventEvalComment.objects.filter(
event=self.context.sched_event).count())
self.assertEqual(
1,
EventEvalBoolean.objects.filter(
event=self.context.sched_event).count())
self.assertRedirects(response, reverse('home', urlconf='gbe.urls'))
示例14: test_copy_child_event
def test_copy_child_event(self):
target_context = StaffAreaContext()
target_day = ConferenceDayFactory(
conference=target_context.conference,
day=self.context.conf_day.day + timedelta(days=340))
data = {
'copy_mode': 'copy_children_only',
'target_event': target_context.area.pk,
'copied_event': self.vol_opp.pk,
'pick_event': "Finish",
}
login_as(self.privileged_user, self)
response = self.client.post(self.url, data=data, follow=True)
max_pk = Event.objects.latest('pk').pk
redirect_url = "%s?%s-day=%d&filter=Filter&new=%s" % (
reverse('manage_event_list',
urlconf='gbe.scheduling.urls',
args=[target_context.conference.conference_slug]),
target_context.conference.conference_slug,
target_day.pk,
str([max_pk]),)
self.assertRedirects(response, redirect_url)
assert_alert_exists(
response,
'success',
'Success',
'Occurrence has been updated.<br>%s, Start Time: %s' % (
self.vol_opp.eventitem.e_title,
datetime.combine(
target_day.day,
self.vol_opp.starttime.time()).strftime(
DATETIME_FORMAT)))
示例15: test_update_profile_has_message
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)