示例#1
0
文件: alias.py 项目: Azula/votabo
    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)
示例#2
0
文件: alias.py 项目: Azula/votabo
    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)
示例#3
0
文件: alias.py 项目: Azula/votabo
    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)
示例#4
0
文件: alias.py 项目: Azula/votabo
    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)
示例#5
0
    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)
示例#6
0
    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)
示例#7
0
    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)
示例#8
0
    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)