def normalized_tags(tags): return list(set(utils.slugify(x.lower()) for x in tags))
def tag_pairs(self): return [(x, utils.slugify(x.lower())) for x in self.tags]
def save(self, *args, **kwargs): if not self.slug: self.slug = slugify(self.title, instance=self) super(Post, self).save(*args, **kwargs)
def test_misc_transforms(input_val, expected_output): generaged_slug = utils.slugify(input_val) assert generaged_slug == expected_output
def test_slugify_unwanted_chars(slug_variation, expected_slug): generaged_slug = utils.slugify(slug_variation) assert generaged_slug == expected_slug
def test_slugify_dash_variations(dash_variation, expected_slug): generaged_slug = utils.slugify(dash_variation) assert dash_variation not in generaged_slug assert generaged_slug == expected_slug
def test_slugify_quote_variations(quote_variation): generaged_slug = utils.slugify(quote_variation) assert quote_variation not in generaged_slug