예제 #1
0
 def test_get_email_from_first_form(self):
     # no fit quiz but the user entered the email before messing up
     view = InquiryApplyWizard()
     email = '*****@*****.**'
     # yapf: disable
     self.assertEqual(
         view._get_email({'email': email, 'password1': 'testpassword1'}, 'first'),
         email
     )
예제 #2
0
    def test_get_email_from_fit_quiz(self):
        # user filled a fit quiz
        view = InquiryApplyWizard()
        view.initial_dict = {}

        # add the fit quiz email cookie to the session
        email = '*****@*****.**'
        request = self._get_request()
        request.session['fit_email'] = email
        request.session.save()
        view.request = request
        self.assertEqual(view._get_email({}, 'first'), email)
예제 #3
0
 def test_get_email_from_first_form_not_fit_quiz(self):
     # user filled a fit quiz but changed the email in the first step
     view = InquiryApplyWizard()
     request = self._get_request()
     fit_quiz_email = '*****@*****.**'
     request.session['fit_email'] = fit_quiz_email
     request.session.save()
     view.request = request
     first_email = '*****@*****.**'
     # yapf: disable
     self.assertEqual(
         view._get_email({'email': first_email, 'password1': 'testpassword1'}, 'first'),
         first_email
     )
예제 #4
0
 def test_get_email_no_client_session_or_form(self):
     # no fit quiz and the user messed up on the first step
     view = InquiryApplyWizard()
     view.initial_dict = {}
     view.request = self._get_request()
     self.assertEqual(view._get_email({}, 'first'), '')