def test_ensure_qualified_slug_not_qualified(self): self.mox.StubOutWithMock(listing_service, 'check_is_qualified_slug') listing_service.check_is_qualified_slug('blahblah').AndReturn(False) self.mox.ReplayAll() with self.assertRaises(ValueError): listing_service.ensure_qualified_slug('blahblah')
def test_check_is_qualified_slug_ok_with_email_address(self): result = listing_service.check_is_qualified_slug( 'cat-go/sub-ct/[email protected]') self.assertTrue(result)
def test_check_is_qualified_slug_ok_with_dashes(self): result = listing_service.check_is_qualified_slug('cat-go/sub-ct/na-me') self.assertTrue(result)
def test_check_is_qualified_slug_ok(self): result = listing_service.check_is_qualified_slug('categor/subcat/name') self.assertTrue(result)
def test_check_is_qualified_slug_skipped_category(self): result = listing_service.check_is_qualified_slug('/subcategory/name') self.assertFalse(result)
def test_check_is_qualified_slug_two_slashes(self): result = listing_service.check_is_qualified_slug('category/subcat') self.assertFalse(result)
def test_ensure_qualified_slug_qualified(self): self.mox.StubOutWithMock(listing_service, 'check_is_qualified_slug') listing_service.check_is_qualified_slug('cat/sub/name').AndReturn(True) self.mox.ReplayAll() listing_service.ensure_qualified_slug('cat/sub/name')