def test_Create_ok(self): info = alias_create(self.mockRequest(POST={"oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez"})) self.assertIsInstance(info, HTTPFound) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertIn(u"Bender", aliases)
def test_AliasList_noResult(self): alias_create(self.mockRequest(POST={"oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez"})) alias_create(self.mockRequest(POST={"oldtag": u"Obama", "newtag": u"Barack_Obama"})) info = alias_list(self.mockRequest(GET={"newtag": u"cats"})) aliases = [alias.oldtag for alias in info["aliases"]] self.assertListEqual([], aliases)
def test_AliasList_blank(self): alias_create(self.mockRequest(POST={"oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez"})) alias_create(self.mockRequest(POST={"oldtag": u"Obama", "newtag": u"Barack_Obama"})) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertIn(u"Bender", aliases)
def test_AliasDelete(self): alias_create(self.mockRequest(POST={"oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez"})) info = alias_delete(self.mockRequest(matchdict={"id": u"Bender"})) self.assertIsInstance(info, HTTPFound) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertListEqual([], aliases)
def test_Create_ok(self): info = alias_create( self.mockRequest(POST={ "oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez" })) self.assertIsInstance(info, HTTPFound) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertIn(u"Bender", aliases)
def test_AliasDelete(self): alias_create( self.mockRequest(POST={ "oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez" })) info = alias_delete(self.mockRequest(matchdict={"id": u"Bender"})) self.assertIsInstance(info, HTTPFound) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertListEqual([], aliases)
def test_AliasList_noResult(self): alias_create( self.mockRequest(POST={ "oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez" })) alias_create( self.mockRequest(POST={ "oldtag": u"Obama", "newtag": u"Barack_Obama" })) info = alias_list(self.mockRequest(GET={"newtag": u"cats"})) aliases = [alias.oldtag for alias in info["aliases"]] self.assertListEqual([], aliases)
def test_AliasList_blank(self): alias_create( self.mockRequest(POST={ "oldtag": u"Bender", "newtag": u"Bender_Bending_Rodriguez" })) alias_create( self.mockRequest(POST={ "oldtag": u"Obama", "newtag": u"Barack_Obama" })) info = alias_list(self.mockRequest()) aliases = [alias.oldtag for alias in info["aliases"]] self.assertIn(u"Bender", aliases)