def test_slugify(self): tag = EventTag(name=u"with space", slug=u"") tag.clean() self.assertEqual(tag.name, "with space") self.assertEqual(tag.slug, "with-space") tag = EventTag(name=u"with&ersand") tag.clean() self.assertEqual(tag.name, "with&ersand") self.assertEqual(tag.slug, "withampersand") tag = EventTag(name=u"with?questionmark") tag.clean() self.assertEqual(tag.name, "with?questionmark") self.assertEqual(tag.slug, "withquestionmark") tag = EventTag(name=u"with#hash") tag.clean() self.assertEqual(tag.name, "with#hash") self.assertEqual(tag.slug, "withhash")
def test_clean_case(self): tag = EventTag(name=u"BIGlettersHERE") tag.clean() self.assertEqual(tag.name, "biglettershere") self.assertEqual(tag.slug, "biglettershere")