1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-25 02:00:06 +00:00
seahub/tests/integration/login.py

23 lines
694 B
Python
Raw Normal View History

2014-08-27 09:13:05 +00:00
from integration import HOME_URL, LOGOUT_URL, get_logged_instance
2014-08-27 03:08:39 +00:00
import unittest
class LoginTestCase(unittest.TestCase):
def setUp(self):
2014-08-27 09:13:05 +00:00
self.browser = get_logged_instance()
2014-08-27 03:08:39 +00:00
self.assertIsNotNone(self.browser)
self.addCleanup(self.browser.quit)
2014-08-29 11:13:55 +00:00
def test_login(self):
2014-08-27 09:13:05 +00:00
self.assertRegexpMatches(self.browser.current_url, HOME_URL)
2014-08-27 03:08:39 +00:00
2014-08-29 11:13:55 +00:00
def test_logout(self):
2014-08-27 03:08:39 +00:00
myinfo_bar = self.browser.find_element_by_css_selector('#my-info')
logout_input = self.browser.find_element_by_css_selector('a#logout')
myinfo_bar.click()
logout_input.click()
2014-08-27 09:13:05 +00:00
self.assertRegexpMatches(self.browser.current_url, LOGOUT_URL)
2014-08-27 03:08:39 +00:00
if __name__ == '__main__':
unittest.main(verbosity=2)