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)
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))
def test_gets_next_order(self): self.assertEqual(2, SubSection.get_next_order(self.section.id))
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))