'1) User goes to a problem page.
2) User fills out an answer to the problem.
3) User is logged out because their session id is invalidated or removed.
4) User clicks "check", and sees a confirmation modal asking them to
re-authenticate, since they\'ve just been logged out.
5) User clicks "ok".
6) User is redirected to the login page.
7) User logs in.
8) User is redirected back to the problem page they started out on.
9) User is able to submit an answer'

def test_logout_after_click_redirect(self):

    self.courseware_page.visit()
    problem_page = ProblemPage(self.browser)
    self.assertEqual(problem_page.problem_name, 'TEST    PROBLEM')
    problem_page.fill_answer_numerical('1')
    self.log_user_out()
    with problem_page.handle_alert(confirm=True):
        problem_page.click_submit()
    login_page = CombinedLoginAndRegisterPage(self.browser)
    login_page.wait_for_page()
    login_page.login(self.email, self.password)
    problem_page.wait_for_page()
    self.assertEqual(problem_page.problem_name, 'TEST    PROBLEM')
    problem_page.fill_answer_numerical('1')
    problem_page.click_submit()
    self.assertTrue(problem_page.simpleprob_is_correct())
