def test_generage_valid_slug_check_existing(self): title = "Hello Title" create_page(title, 'nav_playground.html') # second time with same title, it should append -1 expected_slug = "hello-title-1" slug = _generate_valid_slug(title) self.assertEqual(slug, expected_slug)
def test_generate_valid_slug(self): title = "Hello Title" expected_slug = "hello-title" # empty db, it should just slugify slug = _generate_valid_slug(title) self.assertEqual(slug, expected_slug)