def test_make_slug(self): self.mox.StubOutWithMock(listing_service, 'make_slug_safe') listing_service.make_slug_safe(TEST_NAME).InAnyOrder().AndReturn( TEST_NAME ) listing_service.make_slug_safe(TEST_TAG1).InAnyOrder().AndReturn( TEST_TAG1 ) listing_service.make_slug_safe(TEST_SUBTAG1).InAnyOrder().AndReturn( TEST_SUBTAG1 ) self.mox.ReplayAll() result = listing_service.make_slug(TEST_TAG1, TEST_SUBTAG1, TEST_NAME) self.assertEqual('cat1/subcat1/TestName', result)
def test_make_slug_safe_spaces(self): test_str = "test string" result = listing_service.make_slug_safe(test_str) safe_str = "test string" self.assertEqual(safe_str, result)
def test_make_slug_safe_no_spaces(self): result = listing_service.make_slug_safe(ALL_CHARS_STR) self.assertEqual(ALL_CHARS_STR, result)