def setUp(self): super(TestCase, self).setUp() self.db = StrictRedis(db=15) self.db.flushdb() self.app = WallApp(config={'db': 15}) self.app.add_post_type(TestPost) self.user = self.app.login('Ivanova', 'test') self.app.user = self.user
class TestCase(AsyncTestCase): """ Subclass API: Base for Wall unit tests. Takes care of setting / cleaning up the test environment and provides utilities for testing. Attributes: * `db`: connection to temporary Redis database (`15`) * `app`: Wall application. `TestPost` is available as registered post type. * `user`: active user. """ def setUp(self): super(TestCase, self).setUp() self.db = StrictRedis(db=15) self.db.flushdb() self.app = WallApp(config={'db': 15}) self.app.add_post_type(TestPost) self.user = self.app.login('Ivanova', 'test') self.app.user = self.user def get_new_ioloop(self): return IOLoop.instance()
class TestCase(AsyncTestCase): """ Extension API: Base for Wall unit tests. Takes care of setting / cleaning up the test environment and provides utilities for testing. Attributes: * `db`: connection to temporary Redis database (`15`) * `app`: Wall application. `TestPost` is available as registered post type. """ @classmethod def setUpClass(cls): getLogger('wall').setLevel(CRITICAL) def setUp(self): super(TestCase, self).setUp() self.db = StrictRedis(db=15) self.db.flushdb() self.app = WallApp(config={'db': 15}) self.app.add_post_type(TestPost) def get_new_ioloop(self): return IOLoop.instance()
def setUp(self): super(TestCase, self).setUp() self.db = StrictRedis(db=15) self.db.flushdb() self.app = WallApp(config={'db': 15}) self.app.add_post_type(TestPost)