def test_create_process(self): factory = MsgPageFactory() url = 'url__' thread = {'link':url} msgpage = factory.create(thread) self.assertEquals(msgpage.webclient.url, url)
class TestMsgPageFactory(unittest.TestCase): def setUp(self): self.factory = MsgPageFactory() self.url = 'url__' self.thread = {'link':self.url} def test_create_process(self): msgpage = self.factory.create(self.thread ) self.assertEquals(msgpage.webclient.url, self.url) def test_create_with_id_and_url_not_ending_0(self): id = "id" msgpage = self.factory.create(self.thread, id) result = self.url+"."+id self.assertEquals(msgpage.webclient.url, result) def test_create_with_id_and_url_ending_0(self): id = "id" self.thread['link'] = self.url+".0" msgpage = self.factory.create(self.thread, id) result = self.url+"."+id self.assertEquals(msgpage.webclient.url, result)
def setUp(self): self.factory = MsgPageFactory() self.url = 'url__' self.thread = {'link':self.url}