Ejemplo n.º 1
0
 def test_generage_valid_slug_check_parent(self):
     title = "Hello Title"
     page = create_page(title, 'nav_playground.html', 'en')
     # second time with same title, it should append -1
     expected_slug = "hello-title"
     slug = _generate_valid_slug(title, page, 'en')
     self.assertEqual(slug, expected_slug)
Ejemplo n.º 2
0
 def test_generage_valid_slug_check_parent(self):
     title = "Hello Title"
     page = create_page(title, 'nav_playground.html', 'en')
     # second time with same title, it should append -1
     expected_slug = "hello-title"
     slug = _generate_valid_slug(title, page, 'en')
     self.assertEqual(slug, expected_slug)
Ejemplo n.º 3
0
 def test_generage_valid_slug_check_existing(self):
     title = "Hello Title"
     create_page(title, "nav_playground.html", "en")
     # second time with same title, it should append -1
     expected_slug = "hello-title-1"
     slug = _generate_valid_slug(title, None, "en")
     self.assertEqual(slug, expected_slug)
Ejemplo n.º 4
0
 def test_generate_valid_slug(self):
     title = "Hello Title"
     expected_slug = "hello-title"
     # empty db, it should just slugify
     slug = _generate_valid_slug(title, None, 'en')
     self.assertEqual(slug, expected_slug)
Ejemplo n.º 5
0
 def test_generate_valid_slug(self):
     title = "Hello Title"
     expected_slug = "hello-title"
     # empty db, it should just slugify
     slug = _generate_valid_slug(title, None, 'en')
     self.assertEqual(slug, expected_slug)