Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (20 sloc) 800 Bytes
#-*- coding: utf-8 -*-
import time
from selenose.cases import SeleniumTestCase
from djangosanetesting.cases import HttpTestCase
class AdminTestCase(SeleniumTestCase, HttpTestCase):
def test_login(self):
# Open the administration page
self.driver.get('http://localhost:8000/admin/')
# Enter the name of the user
self.driver.find_element_by_id('id_username').send_keys('admin')
# Get the password input
password = self.driver.find_element_by_id('id_password')
# Type password
password.send_keys('admin')
# Submit the form
password.submit()
# Load page
time.sleep(2)
# Check that welcomed
self.assertTrue(self.driver.find_element_by_id('user-tools').text.startswith('Welcome'))
Something went wrong with that request. Please try again.