本文整理汇总了Python中grades.models.NumericActivity.get_absolute_url方法的典型用法代码示例。如果您正苦于以下问题:Python NumericActivity.get_absolute_url方法的具体用法?Python NumericActivity.get_absolute_url怎么用?Python NumericActivity.get_absolute_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grades.models.NumericActivity
的用法示例。
在下文中一共展示了NumericActivity.get_absolute_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_activity_pages
# 需要导入模块: from grades.models import NumericActivity [as 别名]
# 或者: from grades.models.NumericActivity import get_absolute_url [as 别名]
def test_activity_pages(self):
"""
Test pages around activities
"""
s, c = create_offering()
# add some assignments and members
a = NumericActivity(name="Assignment 1", short_name="A1", status="RLS", offering=c, position=2, max_grade=15, percent=10)
a.save()
a1=a
a = NumericActivity(name="Assignment 2", short_name="A2", status="URLS", offering=c, position=6, max_grade=20, group=True)
a.save()
p = Person.objects.get(userid="ggbaker")
m = Member(person=p, offering=c, role="INST", added_reason="UNK")
m.save()
p = Person.objects.get(userid="0aaa0")
m = Member(person=p, offering=c, role="STUD", added_reason="UNK")
m.save()
# test instructor pages
client = Client()
client.login_user("ggbaker")
response = basic_page_tests(self, client, '/' + c.slug + '/')
self.assertContains(response, 'href="' + reverse('groups.views.groupmanage', kwargs={'course_slug':c.slug}) +'"')
basic_page_tests(self, client, c.get_absolute_url())
basic_page_tests(self, client, reverse('grades.views.student_info', kwargs={'course_slug': c.slug, 'userid': '0aaa0'}))
basic_page_tests(self, client, reverse('grades.views.add_numeric_activity', kwargs={'course_slug':c.slug}))
basic_page_tests(self, client, reverse('grades.views.add_letter_activity', kwargs={'course_slug':c.slug}))
# test student pages
client = Client()
client.login_user("0aaa0")
response = basic_page_tests(self, client, '/' + c.slug + '/')
self.assertContains(response, "Gregory Baker")
self.assertContains(response, 'href="' + reverse('groups.views.groupmanage', kwargs={'course_slug':c.slug}) +'"')
response = basic_page_tests(self, client, a.get_absolute_url())
# small class (one student) shouldn't contain summary stats
self.assertNotContains(response, "Histogram")
self.assertNotContains(response, "Standard Deviation")