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_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)
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())
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())