def test_unconnected_twitter_login(self): with Twill(self.app) as t: self._login_provider(t, 'twitter') self._authorize_twitter(t) self.assertIn( 'Twitter account not associated with an existing user', t.browser.get_html())
def test_connect_twitter(self): with Twill(self.app) as t: self._login(t) self._start_connect(t, 'twitter') self._authorize_twitter(t) self.assertIn('Connection established to Twitter', t.browser.get_html())
def create_app(self): self.twill = Twill(app) file_handler = FileHandler('loggingFile') file_handler.setLevel(logging.DEBUG) app.logger.addHandler(file_handler) app.logger.debug('WTFCAKES') return app
def test_remove_connection(self): with Twill(self.app) as t: self._login(t) self._start_connect(t, 'twitter') self._authorize_twitter(t) self._remove_connection(t, 'twitter') assert 'Connection to Twitter removed' in t.browser.get_html()
def test_double_connect_twitter(self): with Twill(self.app) as t: self._login(t) self._start_connect(t, 'twitter') self._authorize_twitter(t) self._start_connect(t, 'twitter') self._authorize_twitter(t) self.assertIn('A connection is already established with', t.browser.get_html())
def test_connected_login_with_twitter(self): with Twill(self.app) as t: self._login(t) self._start_connect(t, 'twitter') self._authorize_twitter(t) t.browser.go(t.url('/logout')) self._login_provider(t, 'twitter') self._authorize_twitter(t) self.assertIn('Profile Page', t.browser.get_html())
def create_app(self): """Create and return a testing flask app.""" app = create_app(TestConfig) self.twill = Twill(app, port=3000) return app
def test_admin_requires_password(self): t = Twill(self.app) with t: url = t.url('/admin') t.browser.go(url) self.assertTrue('login' in t.browser.result.page)
def test_404(self): with Twill(self.app, port=5000) as t: t.browser.go(t.url('/blah'))
def test_stats(self): with Twill(self.app, port=5000) as t: t.browser.go(t.url('/stats'))
def test_new_listing(self): with Twill(self.app, port=5000) as t: t.browser.go(t.url('/new'))
def test_index(self): with Twill(self.app, port=5000) as t: t.browser.go(t.url('/'))
def create_app(self): from app import create_app as app self.twill = Twill(app) return app
def create_app(self): app = create_app(TestConfig()) self.twill = Twill(app, port=3000) return app
def create_app(self): app = setup_app() self.twill = Twill(app, port=3000) return app