Пример #1
0
 def test_get_two_sections(self):
     section = Section.objects.create(name='ahy2ni9iixaecohwei2U')
     section2 = Section(name='oiriem0saoyiej0eiK8g')
     section2.insert_at(section, position='first-child', save=True)
     UserSectionRelation.objects.create(user=self.user, section=section, progress=1)
     response = self.client.get(reverse('section_list'))
     self.assertTemplateUsed(response, template_name='progress/section_list.html')
Пример #2
0
 def test_get_two_sections(self):
     section = Section.objects.create(name='ahy2ni9iixaecohwei2U')
     section2 = Section(name='oiriem0saoyiej0eiK8g')
     section2.insert_at(section, position='first-child', save=True)
     UserSectionRelation.objects.create(user=self.user, section=section, progress=1)
     response = self.client.get(reverse('section_list'))
     self.assertTemplateUsed(response, template_name='progress/section_list.html')
Пример #3
0
 def test_get_invalid(self):
     section = Section.objects.create(name='Aikahnareefai5toh7eZ')
     section2 = Section(name='foo5oi2AoT5equ0wei8o')
     section2.insert_at(section, position='first-child', save=True)
     response = self.client.get(
         reverse('usersectionrelation_update', kwargs={'pk': section.pk}))
     self.assertEqual(response.status_code, 404)
Пример #4
0
 def test_get_invalid(self):
     section = Section.objects.create(name='Aikahnareefai5toh7eZ')
     section2 = Section(name='foo5oi2AoT5equ0wei8o')
     section2.insert_at(section, position='first-child', save=True)
     response = self.client.get(reverse('usersectionrelation_update', kwargs={'pk': section.pk}))
     self.assertEqual(response.status_code, 404)