Exemple #1
0
 def test_category_can_be_referenced_by_only_one_subdomain(self):
     cs1 = CategorySubdomain(category=self.category_nested_2,
                             subdomain_slug=self.category_nested_2.slug)
     cs1.save()
     cs2 = CategorySubdomain(category=self.category_nested_2,
                             subdomain_slug=self.category_nested_2.slug)
     tools.assert_raises(IntegrityError, cs2.save)
Exemple #2
0
 def test_second_level_category_cannot_be_user_for_subdomain(self):
     cs = CategorySubdomain(
         category=self.category_nested_nested_2,
         subdomain_slug=self.category_nested_nested_2.slug)
     tools.assert_raises(ValidationError, cs.clean)
Exemple #3
0
 def test_first_level_category_validates_for_subdomain(self):
     cs = CategorySubdomain(category=self.category_nested_1,
                            subdomain_slug=self.category_nested_1.slug)
     tools.assert_false(cs.clean())
Exemple #4
0
 def test_root_category_cannot_be_user_for_subdomain(self):
     cs = CategorySubdomain(category=self.category_root,
                            subdomain_slug=self.category_root.slug)
     tools.assert_raises(ValidationError, cs.clean)
 def test_category_can_be_referenced_by_only_one_subdomain(self):
     cs1 = CategorySubdomain(category = self.category_nested_2, subdomain_slug = self.category_nested_2.slug)
     cs1.save()
     cs2 = CategorySubdomain(category = self.category_nested_2, subdomain_slug = self.category_nested_2.slug)
     tools.assert_raises(IntegrityError, cs2.save)
 def test_first_level_category_validates_for_subdomain(self):
     cs = CategorySubdomain(category = self.category_nested_1, subdomain_slug = self.category_nested_1.slug)
     tools.assert_false(cs.clean())