def testResetPassword(self):
    self.driver.get(self.url)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('login')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('id_username')
    self.elem.send_keys(self.user)
    self.elem = self.driver.find_element_by_id('id_password')
    self.elem.send_keys(self.password)
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('logout')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('login')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('resetpassword')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('id_email')
    self.elem.send_keys(self.user)
    time.sleep(3)
    self.user_filter = User.objects.filter(Q(email=self.user))
    for self.user in self.user_filter:
        print(self.user)
        self.token = default_token_generator.make_token(self.user)
        print(self.token)
        self.uid = urlsafe_base64_encode(force_bytes(self.user.pk))
        print(self.uid)
    self.driver.get((self.url + ('reset/%s/%s/' % (self.uid, self.token))))
    time.sleep(3)
    self.driver.find_element_by_id('id_new_password1').send_keys(self.newpassword)
    self.driver.find_element_by_id('id_new_password2').send_keys(self.newpassword)
    self.elem = self.driver.find_element_by_id('id_new_password2')
    time.sleep(3)
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.driver.quit()
def testResetPassword(self):
    self.driver.get(self.url)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('login')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('id_username')
    self.elem.send_keys(self.user)
    self.elem = self.driver.find_element_by_id('id_password')
    self.elem.send_keys(self.password)
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('logout')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('login')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(5)
    self.elem = self.driver.find_element_by_id('resetpassword')
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.elem = self.driver.find_element_by_id('id_email')
    self.elem.send_keys(self.user)
    time.sleep(3)
    self.user_filter = User.objects.filter(Q(email=self.user))
    for self.user in self.user_filter:
        print(self.user)
        self.token = default_token_generator.make_token(self.user)
        print(self.token)
        self.uid = urlsafe_base64_encode(force_bytes(self.user.pk))
        print(self.uid)
    self.driver.get((self.url + ('reset/%s/%s/' % (self.uid, self.token))))
    time.sleep(3)
    self.driver.find_element_by_id('id_new_password1').send_keys(self.newpassword)
    self.driver.find_element_by_id('id_new_password2').send_keys(self.newpassword)
    self.elem = self.driver.find_element_by_id('id_new_password2')
    time.sleep(3)
    self.elem.send_keys(Keys.RETURN)
    time.sleep(3)
    self.driver.quit()