示例#1
0
 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())
示例#2
0
 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())
示例#3
0
 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
示例#4
0
 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()
示例#5
0
 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())
示例#6
0
 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())
示例#7
0
    def create_app(self):
        """Create and return a testing flask app."""

        app = create_app(TestConfig)
        self.twill = Twill(app, port=3000)
        return app
示例#8
0
 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)
示例#9
0
 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)
示例#10
0
 def test_404(self):
     with Twill(self.app, port=5000) as t:
         t.browser.go(t.url('/blah'))
示例#11
0
 def test_stats(self):
     with Twill(self.app, port=5000) as t:
         t.browser.go(t.url('/stats'))
示例#12
0
 def test_new_listing(self):
     with Twill(self.app, port=5000) as t:
         t.browser.go(t.url('/new'))
示例#13
0
 def test_index(self):
     with Twill(self.app, port=5000) as t:
         t.browser.go(t.url('/'))
示例#14
0
 def create_app(self):
     from app import create_app as app
     self.twill = Twill(app)
     return app
示例#15
0
 def create_app(self):
     app = create_app(TestConfig())
     self.twill = Twill(app, port=3000)
     return app
示例#16
0
 def create_app(self):
     app = setup_app()
     self.twill = Twill(app, port=3000)
     return app