Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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())
Ejemplo n.º 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)
Ejemplo n.º 5
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)
Ejemplo n.º 6
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())