~nataliabidart/ubuntu-sso-client/displayname-stable

« back to all changes in this revision

Viewing changes to ubuntu_sso/tests/test_gui.py

The verify email page should be always built, not only on registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1011
1011
                          dict(reply_handler=gui.NO_OP,
1012
1012
                               error_handler=gui.NO_OP)))
1013
1013
 
 
1014
    def test_on_verify_token_button_clicked(self):
 
1015
        """Verify token uses cached user_email and user_password."""
 
1016
        self.ui.user_email = 'test@me.com'
 
1017
        self.ui.user_password = 'yadda-yedda'
 
1018
        self.ui.on_verify_token_button_clicked()
 
1019
        self.assertEqual(self.ui.backend._called['validate_email'],
 
1020
                         ((APP_NAME, self.ui.user_email,
 
1021
                           self.ui.user_password, EMAIL_TOKEN),
 
1022
                          dict(reply_handler=gui.NO_OP,
 
1023
                               error_handler=gui.NO_OP)))
 
1024
 
1014
1025
    def test_on_verify_token_button_shows_processing_page(self):
1015
1026
        """Verify token button triggers call to backend."""
1016
1027
        self.click_verify_email_with_valid_data()
1085
1096
 
1086
1097
 
1087
1098
class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase):
1088
 
    """Test suite for the user registration (verify email page)."""
 
1099
    """Test suite for the user registration validation (verify email page)."""
1089
1100
 
1090
1101
    def setUp(self):
1091
1102
        """Init."""
1120
1131
        self.assert_warnings_visibility()
1121
1132
 
1122
1133
 
 
1134
class VerifyEmailLoginOnlyTestCase(VerifyEmailTestCase):
 
1135
    """Test suite for the user login (verify email page)."""
 
1136
 
 
1137
    kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
 
1138
                  login_only=True)
 
1139
 
 
1140
 
 
1141
class VerifyEmailValidationLoginOnlyTestCase(VerifyEmailValidationTestCase):
 
1142
    """Test suite for the user login validation (verify email page)."""
 
1143
 
 
1144
    kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
 
1145
                  login_only=True)
 
1146
 
 
1147
 
1123
1148
class RegistrationValidationTestCase(UbuntuSSOClientTestCase):
1124
1149
    """Test suite for the user registration  validations."""
1125
1150