~mandel/ubuntu-sso-client/pinned-certs

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/tests/test_setup_account.py

  • Committer: Natalia B. Bidart
  • Date: 2012-03-13 03:10:00 UTC
  • mto: (846.22.36 ubuntu-sso-client)
  • mto: This revision was merged to the branch mainline in revision 950.
  • Revision ID: natalia.bidart@canonical.com-20120313031000-jbiapseqwunpxiod
Fixed tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        self.ui.ui.name_edit.setText("")
45
45
        self.ui.name_assistance()
46
46
        self.assertTrue(self.ui.ui.name_assistance.isVisible())
47
 
        self.assert_error_correct(self.ui.ui.name_assistance, gui.EMPTY_NAME)
 
47
        self.assert_error_correct(self.ui.ui.name_assistance, gui.EMPTY_NAME,
 
48
                                  max_width=self.ui.header.max_title_width)
48
49
 
49
50
    def test_enable_setup_button_with_visible_check(self):
50
51
        """Test _enable_setup_button method with terms check visible."""
225
226
        self.ui.email_assistance()
226
227
        self.ui.set_error_message(self.ui.ui.email_assistance, "message")
227
228
        self.assertTrue(self.ui.ui.email_assistance.isVisible())
228
 
        self.assertEqual(self.ui.ui.email_assistance, "message")
 
229
        self.assert_error_correct(self.ui.ui.email_assistance, "message",
 
230
                                  max_width=self.ui.header.max_title_width)
229
231
 
230
232
    def test_blank_name(self):
231
233
        """Status when the name field is blank (spaces).
236
238
        self.ui.ui.name_edit.setText("  ")
237
239
        self.ui.name_assistance()
238
240
        self.assertTrue(self.ui.ui.name_assistance.isVisible())
239
 
        self.assertEqual(self.ui.ui.name_assistance, gui.EMPTY_NAME)
 
241
        self.assert_error_correct(self.ui.ui.name_assistance, gui.EMPTY_NAME,
 
242
                                  max_width=self.ui.header.max_title_width)
240
243
 
241
244
    def test_valid_name(self):
242
245
        """Status when the name field is valid.
256
259
        self.ui.ui.email_edit.setText("foobar")
257
260
        self.ui.email_assistance()
258
261
        self.assertTrue(self.ui.ui.email_assistance.isVisible())
259
 
        self.assertEqual(self.ui.ui.email_assistance, gui.INVALID_EMAIL)
 
262
        self.assert_error_correct(self.ui.ui.email_assistance,
 
263
                                  gui.INVALID_EMAIL,
 
264
                                  max_width=self.ui.header.max_title_width)
260
265
 
261
266
    def test_valid_email(self):
262
267
        """Status when the email field has a @.
287
292
        self.ui.ui.confirm_email_edit.setText("foo@baz")
288
293
        self.ui.confirm_email_assistance()
289
294
        self.assertTrue(self.ui.ui.confirm_email_assistance.isVisible())
290
 
        self.assertEqual(self.ui.ui.confirm_email_assistance, gui.EMAIL_MATCH)
 
295
        self.assert_error_correct(self.ui.ui.confirm_email_assistance,
 
296
                                  gui.EMAIL_MATCH,
 
297
                                  max_width=self.ui.header.max_title_width)
291
298
 
292
299
    def test_focus_changed_password_visibility(self):
293
300
        """Check visibility changes when focus_changed() is executed."""