Exemplo n.º 1
0
 def test_sub_section_fields(self):
     sub_section = SubSection()
     fields = [str(item.attname) for item in sub_section._meta.fields]
     self.assertEqual(7, len(fields))
     for field in [
             'id', 'created', 'modified', 'title', 'order', 'section_id',
             'description'
     ]:
         self.assertIn(field, fields)
Exemplo n.º 2
0
 def test_next_order_starts_from_0_if_no_sections_exists_in_a_questionnaire(self):
     SubSection.objects.filter(section=self.section).delete()
     self.assertEqual(0, SubSection.get_next_order(self.section.id))
Exemplo n.º 3
0
 def test_gets_next_order(self):
     self.assertEqual(2, SubSection.get_next_order(self.section.id))
Exemplo n.º 4
0
 def test_next_order_starts_from_0_if_no_sections_exists_in_a_questionnaire(
         self):
     SubSection.objects.filter(section=self.section).delete()
     self.assertEqual(0, SubSection.get_next_order(self.section.id))
Exemplo n.º 5
0
 def test_gets_next_order(self):
     self.assertEqual(2, SubSection.get_next_order(self.section.id))