Merge lp:~diegosarmentero/ubuntuone-windows-installer/setupaccount-form-behavior into lp:ubuntuone-windows-installer
- setupaccount-form-behavior
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 54 |
Merged at revision: | 34 |
Proposed branch: | lp:~diegosarmentero/ubuntuone-windows-installer/setupaccount-form-behavior |
Merge into: | lp:ubuntuone-windows-installer |
Diff against target: |
1184 lines (+609/-148) 4 files modified
data/qt/setup_account.ui (+289/-53) data/qt/ubuntuone.qss (+8/-3) ubuntuone_installer/gui/qt/setup_account.py (+83/-26) ubuntuone_installer/gui/qt/tests/test_gui.py (+229/-66) |
To merge this branch: | bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/setupaccount-form-behavior |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
- 40. By Diego Sarmentero
-
adding more tests and fixing lint issues
- 41. By Diego Sarmentero
-
link branch to bug
- 42. By Diego Sarmentero
-
fixing some issues in setup_account.ui
- 43. By Diego Sarmentero
-
connecting signal on showEvent and disconnecting signal on hideEvent.
Avoid setup account resizing on form errors. - 44. By Diego Sarmentero
-
fixing some connections in setup_account.
adding more tests to: focus_changed - 45. By Diego Sarmentero
-
fixing some issues related to focus managment.
- 46. By Diego Sarmentero
-
setting password_assistance to visible = True if the user click on confirmation password
- 47. By Diego Sarmentero
-
tests improved.
- 48. By Diego Sarmentero
-
fixing some tests to use assertIn
- 49. By Diego Sarmentero
-
fixing test to user assertNotIn
- 50. By Diego Sarmentero
-
fixing docstrings
- 51. By Diego Sarmentero
-
removing password_
assistance_ in_focus to avoid code duplication.
fixing tests related to this method. - 52. By Diego Sarmentero
-
docstring fixed.
tests modified to be more clear. - 53. By Diego Sarmentero
-
adding missing docstrings to the new methods.
- 54. By Diego Sarmentero
-
adding missing docstrings.
fixing some lint issues.
Preview Diff
1 | === modified file 'data/qt/setup_account.ui' | |||
2 | --- data/qt/setup_account.ui 2011-08-17 14:22:25 +0000 | |||
3 | +++ data/qt/setup_account.ui 2011-08-22 14:08:26 +0000 | |||
4 | @@ -7,7 +7,7 @@ | |||
5 | 7 | <x>0</x> | 7 | <x>0</x> |
6 | 8 | <y>0</y> | 8 | <y>0</y> |
7 | 9 | <width>575</width> | 9 | <width>575</width> |
9 | 10 | <height>521</height> | 10 | <height>573</height> |
10 | 11 | </rect> | 11 | </rect> |
11 | 12 | </property> | 12 | </property> |
12 | 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
13 | @@ -18,7 +18,7 @@ | |||
14 | 18 | <number>6</number> | 18 | <number>6</number> |
15 | 19 | </property> | 19 | </property> |
16 | 20 | <item> | 20 | <item> |
18 | 21 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="300,250"> | 21 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="310,250"> |
19 | 22 | <item row="0" column="0"> | 22 | <item row="0" column="0"> |
20 | 23 | <widget class="QLabel" name="password_info_label"> | 23 | <widget class="QLabel" name="password_info_label"> |
21 | 24 | <property name="sizePolicy"> | 24 | <property name="sizePolicy"> |
22 | @@ -55,29 +55,37 @@ | |||
23 | 55 | </item> | 55 | </item> |
24 | 56 | <item> | 56 | <item> |
25 | 57 | <widget class="QLineEdit" name="name_edit"> | 57 | <widget class="QLineEdit" name="name_edit"> |
26 | 58 | <property name="sizePolicy"> | ||
27 | 59 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
28 | 60 | <horstretch>0</horstretch> | ||
29 | 61 | <verstretch>0</verstretch> | ||
30 | 62 | </sizepolicy> | ||
31 | 63 | </property> | ||
32 | 64 | <property name="minimumSize"> | ||
33 | 65 | <size> | ||
34 | 66 | <width>300</width> | ||
35 | 67 | <height>0</height> | ||
36 | 68 | </size> | ||
37 | 69 | </property> | ||
38 | 70 | <property name="maximumSize"> | ||
39 | 71 | <size> | ||
40 | 72 | <width>300</width> | ||
41 | 73 | <height>16777215</height> | ||
42 | 74 | </size> | ||
43 | 75 | </property> | ||
44 | 58 | <property name="font"> | 76 | <property name="font"> |
45 | 59 | <font> | 77 | <font> |
46 | 60 | <pointsize>11</pointsize> | 78 | <pointsize>11</pointsize> |
47 | 61 | </font> | 79 | </font> |
48 | 62 | </property> | 80 | </property> |
49 | 81 | <property name="formError" stdset="0"> | ||
50 | 82 | <bool>false</bool> | ||
51 | 83 | </property> | ||
52 | 63 | </widget> | 84 | </widget> |
53 | 64 | </item> | 85 | </item> |
54 | 65 | </layout> | 86 | </layout> |
55 | 66 | </item> | 87 | </item> |
70 | 67 | <item row="1" column="1"> | 88 | <item row="3" column="0"> |
57 | 68 | <widget class="QLabel" name="name_assistance"> | ||
58 | 69 | <property name="text"> | ||
59 | 70 | <string>name_assistance</string> | ||
60 | 71 | </property> | ||
61 | 72 | <property name="alignment"> | ||
62 | 73 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | ||
63 | 74 | </property> | ||
64 | 75 | <property name="indent"> | ||
65 | 76 | <number>20</number> | ||
66 | 77 | </property> | ||
67 | 78 | </widget> | ||
68 | 79 | </item> | ||
69 | 80 | <item row="2" column="0"> | ||
71 | 81 | <layout class="QVBoxLayout" name="verticalLayout"> | 89 | <layout class="QVBoxLayout" name="verticalLayout"> |
72 | 82 | <property name="spacing"> | 90 | <property name="spacing"> |
73 | 83 | <number>3</number> | 91 | <number>3</number> |
74 | @@ -97,6 +105,24 @@ | |||
75 | 97 | </item> | 105 | </item> |
76 | 98 | <item> | 106 | <item> |
77 | 99 | <widget class="QLineEdit" name="email_edit"> | 107 | <widget class="QLineEdit" name="email_edit"> |
78 | 108 | <property name="sizePolicy"> | ||
79 | 109 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
80 | 110 | <horstretch>0</horstretch> | ||
81 | 111 | <verstretch>0</verstretch> | ||
82 | 112 | </sizepolicy> | ||
83 | 113 | </property> | ||
84 | 114 | <property name="minimumSize"> | ||
85 | 115 | <size> | ||
86 | 116 | <width>300</width> | ||
87 | 117 | <height>0</height> | ||
88 | 118 | </size> | ||
89 | 119 | </property> | ||
90 | 120 | <property name="maximumSize"> | ||
91 | 121 | <size> | ||
92 | 122 | <width>300</width> | ||
93 | 123 | <height>16777215</height> | ||
94 | 124 | </size> | ||
95 | 125 | </property> | ||
96 | 100 | <property name="font"> | 126 | <property name="font"> |
97 | 101 | <font> | 127 | <font> |
98 | 102 | <pointsize>11</pointsize> | 128 | <pointsize>11</pointsize> |
99 | @@ -105,21 +131,14 @@ | |||
100 | 105 | <property name="placeholderText"> | 131 | <property name="placeholderText"> |
101 | 106 | <string/> | 132 | <string/> |
102 | 107 | </property> | 133 | </property> |
103 | 134 | <property name="formError" stdset="0"> | ||
104 | 135 | <bool>false</bool> | ||
105 | 136 | </property> | ||
106 | 108 | </widget> | 137 | </widget> |
107 | 109 | </item> | 138 | </item> |
108 | 110 | </layout> | 139 | </layout> |
109 | 111 | </item> | 140 | </item> |
121 | 112 | <item row="2" column="1"> | 141 | <item row="4" column="0"> |
111 | 113 | <widget class="QLabel" name="email_assistance"> | ||
112 | 114 | <property name="text"> | ||
113 | 115 | <string>email_assistance</string> | ||
114 | 116 | </property> | ||
115 | 117 | <property name="indent"> | ||
116 | 118 | <number>20</number> | ||
117 | 119 | </property> | ||
118 | 120 | </widget> | ||
119 | 121 | </item> | ||
120 | 122 | <item row="3" column="0"> | ||
122 | 123 | <layout class="QVBoxLayout" name="verticalLayout"> | 142 | <layout class="QVBoxLayout" name="verticalLayout"> |
123 | 124 | <property name="spacing"> | 143 | <property name="spacing"> |
124 | 125 | <number>3</number> | 144 | <number>3</number> |
125 | @@ -139,6 +158,24 @@ | |||
126 | 139 | </item> | 158 | </item> |
127 | 140 | <item> | 159 | <item> |
128 | 141 | <widget class="QLineEdit" name="confirm_email_edit"> | 160 | <widget class="QLineEdit" name="confirm_email_edit"> |
129 | 161 | <property name="sizePolicy"> | ||
130 | 162 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
131 | 163 | <horstretch>0</horstretch> | ||
132 | 164 | <verstretch>0</verstretch> | ||
133 | 165 | </sizepolicy> | ||
134 | 166 | </property> | ||
135 | 167 | <property name="minimumSize"> | ||
136 | 168 | <size> | ||
137 | 169 | <width>300</width> | ||
138 | 170 | <height>0</height> | ||
139 | 171 | </size> | ||
140 | 172 | </property> | ||
141 | 173 | <property name="maximumSize"> | ||
142 | 174 | <size> | ||
143 | 175 | <width>300</width> | ||
144 | 176 | <height>16777215</height> | ||
145 | 177 | </size> | ||
146 | 178 | </property> | ||
147 | 142 | <property name="font"> | 179 | <property name="font"> |
148 | 143 | <font> | 180 | <font> |
149 | 144 | <pointsize>11</pointsize> | 181 | <pointsize>11</pointsize> |
150 | @@ -147,21 +184,14 @@ | |||
151 | 147 | <property name="placeholderText"> | 184 | <property name="placeholderText"> |
152 | 148 | <string/> | 185 | <string/> |
153 | 149 | </property> | 186 | </property> |
154 | 187 | <property name="formError" stdset="0"> | ||
155 | 188 | <bool>false</bool> | ||
156 | 189 | </property> | ||
157 | 150 | </widget> | 190 | </widget> |
158 | 151 | </item> | 191 | </item> |
159 | 152 | </layout> | 192 | </layout> |
160 | 153 | </item> | 193 | </item> |
172 | 154 | <item row="3" column="1"> | 194 | <item row="6" column="0"> |
162 | 155 | <widget class="QLabel" name="confirm_email_assistance"> | ||
163 | 156 | <property name="text"> | ||
164 | 157 | <string>confirm_email_assistance</string> | ||
165 | 158 | </property> | ||
166 | 159 | <property name="indent"> | ||
167 | 160 | <number>20</number> | ||
168 | 161 | </property> | ||
169 | 162 | </widget> | ||
170 | 163 | </item> | ||
171 | 164 | <item row="4" column="0"> | ||
173 | 165 | <layout class="QVBoxLayout" name="verticalLayout"> | 195 | <layout class="QVBoxLayout" name="verticalLayout"> |
174 | 166 | <property name="spacing"> | 196 | <property name="spacing"> |
175 | 167 | <number>3</number> | 197 | <number>3</number> |
176 | @@ -181,6 +211,24 @@ | |||
177 | 181 | </item> | 211 | </item> |
178 | 182 | <item> | 212 | <item> |
179 | 183 | <widget class="QLineEdit" name="password_edit"> | 213 | <widget class="QLineEdit" name="password_edit"> |
180 | 214 | <property name="sizePolicy"> | ||
181 | 215 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
182 | 216 | <horstretch>0</horstretch> | ||
183 | 217 | <verstretch>0</verstretch> | ||
184 | 218 | </sizepolicy> | ||
185 | 219 | </property> | ||
186 | 220 | <property name="minimumSize"> | ||
187 | 221 | <size> | ||
188 | 222 | <width>300</width> | ||
189 | 223 | <height>0</height> | ||
190 | 224 | </size> | ||
191 | 225 | </property> | ||
192 | 226 | <property name="maximumSize"> | ||
193 | 227 | <size> | ||
194 | 228 | <width>300</width> | ||
195 | 229 | <height>16777215</height> | ||
196 | 230 | </size> | ||
197 | 231 | </property> | ||
198 | 184 | <property name="font"> | 232 | <property name="font"> |
199 | 185 | <font> | 233 | <font> |
200 | 186 | <pointsize>11</pointsize> | 234 | <pointsize>11</pointsize> |
201 | @@ -198,11 +246,14 @@ | |||
202 | 198 | <property name="placeholderText"> | 246 | <property name="placeholderText"> |
203 | 199 | <string/> | 247 | <string/> |
204 | 200 | </property> | 248 | </property> |
205 | 249 | <property name="formError" stdset="0"> | ||
206 | 250 | <bool>false</bool> | ||
207 | 251 | </property> | ||
208 | 201 | </widget> | 252 | </widget> |
209 | 202 | </item> | 253 | </item> |
210 | 203 | </layout> | 254 | </layout> |
211 | 204 | </item> | 255 | </item> |
213 | 205 | <item row="5" column="0"> | 256 | <item row="7" column="0"> |
214 | 206 | <layout class="QVBoxLayout" name="verticalLayout"> | 257 | <layout class="QVBoxLayout" name="verticalLayout"> |
215 | 207 | <property name="spacing"> | 258 | <property name="spacing"> |
216 | 208 | <number>3</number> | 259 | <number>3</number> |
217 | @@ -222,6 +273,24 @@ | |||
218 | 222 | </item> | 273 | </item> |
219 | 223 | <item> | 274 | <item> |
220 | 224 | <widget class="QLineEdit" name="confirm_password_edit"> | 275 | <widget class="QLineEdit" name="confirm_password_edit"> |
221 | 276 | <property name="sizePolicy"> | ||
222 | 277 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
223 | 278 | <horstretch>0</horstretch> | ||
224 | 279 | <verstretch>0</verstretch> | ||
225 | 280 | </sizepolicy> | ||
226 | 281 | </property> | ||
227 | 282 | <property name="minimumSize"> | ||
228 | 283 | <size> | ||
229 | 284 | <width>300</width> | ||
230 | 285 | <height>0</height> | ||
231 | 286 | </size> | ||
232 | 287 | </property> | ||
233 | 288 | <property name="maximumSize"> | ||
234 | 289 | <size> | ||
235 | 290 | <width>300</width> | ||
236 | 291 | <height>16777215</height> | ||
237 | 292 | </size> | ||
238 | 293 | </property> | ||
239 | 225 | <property name="font"> | 294 | <property name="font"> |
240 | 226 | <font> | 295 | <font> |
241 | 227 | <pointsize>11</pointsize> | 296 | <pointsize>11</pointsize> |
242 | @@ -233,21 +302,14 @@ | |||
243 | 233 | <property name="placeholderText"> | 302 | <property name="placeholderText"> |
244 | 234 | <string/> | 303 | <string/> |
245 | 235 | </property> | 304 | </property> |
246 | 305 | <property name="formError" stdset="0"> | ||
247 | 306 | <bool>false</bool> | ||
248 | 307 | </property> | ||
249 | 236 | </widget> | 308 | </widget> |
250 | 237 | </item> | 309 | </item> |
251 | 238 | </layout> | 310 | </layout> |
252 | 239 | </item> | 311 | </item> |
264 | 240 | <item row="4" column="1" rowspan="2"> | 312 | <item row="8" column="0"> |
254 | 241 | <widget class="QLabel" name="password_assistance"> | ||
255 | 242 | <property name="text"> | ||
256 | 243 | <string>password_assistance</string> | ||
257 | 244 | </property> | ||
258 | 245 | <property name="indent"> | ||
259 | 246 | <number>20</number> | ||
260 | 247 | </property> | ||
261 | 248 | </widget> | ||
262 | 249 | </item> | ||
263 | 250 | <item row="6" column="0"> | ||
265 | 251 | <layout class="QVBoxLayout" name="verticalLayout"> | 313 | <layout class="QVBoxLayout" name="verticalLayout"> |
266 | 252 | <property name="spacing"> | 314 | <property name="spacing"> |
267 | 253 | <number>3</number> | 315 | <number>3</number> |
268 | @@ -255,7 +317,7 @@ | |||
269 | 255 | <item> | 317 | <item> |
270 | 256 | <widget class="QLabel" name="captcha_view"> | 318 | <widget class="QLabel" name="captcha_view"> |
271 | 257 | <property name="sizePolicy"> | 319 | <property name="sizePolicy"> |
273 | 258 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | 320 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> |
274 | 259 | <horstretch>0</horstretch> | 321 | <horstretch>0</horstretch> |
275 | 260 | <verstretch>0</verstretch> | 322 | <verstretch>0</verstretch> |
276 | 261 | </sizepolicy> | 323 | </sizepolicy> |
277 | @@ -266,6 +328,12 @@ | |||
278 | 266 | <height>57</height> | 328 | <height>57</height> |
279 | 267 | </size> | 329 | </size> |
280 | 268 | </property> | 330 | </property> |
281 | 331 | <property name="maximumSize"> | ||
282 | 332 | <size> | ||
283 | 333 | <width>300</width> | ||
284 | 334 | <height>16777215</height> | ||
285 | 335 | </size> | ||
286 | 336 | </property> | ||
287 | 269 | <property name="styleSheet"> | 337 | <property name="styleSheet"> |
288 | 270 | <string notr="true">background-color: white</string> | 338 | <string notr="true">background-color: white</string> |
289 | 271 | </property> | 339 | </property> |
290 | @@ -279,6 +347,24 @@ | |||
291 | 279 | </item> | 347 | </item> |
292 | 280 | <item> | 348 | <item> |
293 | 281 | <widget class="QLineEdit" name="captcha_solution_edit"> | 349 | <widget class="QLineEdit" name="captcha_solution_edit"> |
294 | 350 | <property name="sizePolicy"> | ||
295 | 351 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
296 | 352 | <horstretch>0</horstretch> | ||
297 | 353 | <verstretch>0</verstretch> | ||
298 | 354 | </sizepolicy> | ||
299 | 355 | </property> | ||
300 | 356 | <property name="minimumSize"> | ||
301 | 357 | <size> | ||
302 | 358 | <width>300</width> | ||
303 | 359 | <height>0</height> | ||
304 | 360 | </size> | ||
305 | 361 | </property> | ||
306 | 362 | <property name="maximumSize"> | ||
307 | 363 | <size> | ||
308 | 364 | <width>300</width> | ||
309 | 365 | <height>16777215</height> | ||
310 | 366 | </size> | ||
311 | 367 | </property> | ||
312 | 282 | <property name="font"> | 368 | <property name="font"> |
313 | 283 | <font> | 369 | <font> |
314 | 284 | <pointsize>11</pointsize> | 370 | <pointsize>11</pointsize> |
315 | @@ -296,18 +382,27 @@ | |||
316 | 296 | <property name="placeholderText"> | 382 | <property name="placeholderText"> |
317 | 297 | <string/> | 383 | <string/> |
318 | 298 | </property> | 384 | </property> |
319 | 385 | <property name="formError" stdset="0"> | ||
320 | 386 | <bool>false</bool> | ||
321 | 387 | </property> | ||
322 | 299 | </widget> | 388 | </widget> |
323 | 300 | </item> | 389 | </item> |
324 | 301 | </layout> | 390 | </layout> |
325 | 302 | </item> | 391 | </item> |
327 | 303 | <item row="6" column="1"> | 392 | <item row="8" column="1"> |
328 | 304 | <widget class="QLabel" name="refresh_label"> | 393 | <widget class="QLabel" name="refresh_label"> |
329 | 305 | <property name="sizePolicy"> | 394 | <property name="sizePolicy"> |
331 | 306 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | 395 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
332 | 307 | <horstretch>0</horstretch> | 396 | <horstretch>0</horstretch> |
333 | 308 | <verstretch>0</verstretch> | 397 | <verstretch>0</verstretch> |
334 | 309 | </sizepolicy> | 398 | </sizepolicy> |
335 | 310 | </property> | 399 | </property> |
336 | 400 | <property name="maximumSize"> | ||
337 | 401 | <size> | ||
338 | 402 | <width>300</width> | ||
339 | 403 | <height>16777215</height> | ||
340 | 404 | </size> | ||
341 | 405 | </property> | ||
342 | 311 | <property name="locale"> | 406 | <property name="locale"> |
343 | 312 | <locale language="English" country="UnitedStates"/> | 407 | <locale language="English" country="UnitedStates"/> |
344 | 313 | </property> | 408 | </property> |
345 | @@ -322,6 +417,147 @@ | |||
346 | 322 | </property> | 417 | </property> |
347 | 323 | </widget> | 418 | </widget> |
348 | 324 | </item> | 419 | </item> |
349 | 420 | <item row="1" column="1"> | ||
350 | 421 | <layout class="QVBoxLayout" name="verticalLayout_7"> | ||
351 | 422 | <property name="leftMargin"> | ||
352 | 423 | <number>10</number> | ||
353 | 424 | </property> | ||
354 | 425 | <item> | ||
355 | 426 | <widget class="QLabel" name="name_assistance"> | ||
356 | 427 | <property name="sizePolicy"> | ||
357 | 428 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
358 | 429 | <horstretch>0</horstretch> | ||
359 | 430 | <verstretch>0</verstretch> | ||
360 | 431 | </sizepolicy> | ||
361 | 432 | </property> | ||
362 | 433 | <property name="maximumSize"> | ||
363 | 434 | <size> | ||
364 | 435 | <width>300</width> | ||
365 | 436 | <height>16777215</height> | ||
366 | 437 | </size> | ||
367 | 438 | </property> | ||
368 | 439 | <property name="text"> | ||
369 | 440 | <string>name_assistance</string> | ||
370 | 441 | </property> | ||
371 | 442 | <property name="alignment"> | ||
372 | 443 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
373 | 444 | </property> | ||
374 | 445 | </widget> | ||
375 | 446 | </item> | ||
376 | 447 | </layout> | ||
377 | 448 | </item> | ||
378 | 449 | <item row="3" column="1"> | ||
379 | 450 | <layout class="QVBoxLayout" name="verticalLayout_8"> | ||
380 | 451 | <property name="leftMargin"> | ||
381 | 452 | <number>10</number> | ||
382 | 453 | </property> | ||
383 | 454 | <item> | ||
384 | 455 | <widget class="QLabel" name="email_assistance"> | ||
385 | 456 | <property name="sizePolicy"> | ||
386 | 457 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
387 | 458 | <horstretch>0</horstretch> | ||
388 | 459 | <verstretch>0</verstretch> | ||
389 | 460 | </sizepolicy> | ||
390 | 461 | </property> | ||
391 | 462 | <property name="maximumSize"> | ||
392 | 463 | <size> | ||
393 | 464 | <width>300</width> | ||
394 | 465 | <height>16777215</height> | ||
395 | 466 | </size> | ||
396 | 467 | </property> | ||
397 | 468 | <property name="text"> | ||
398 | 469 | <string>email_assistance</string> | ||
399 | 470 | </property> | ||
400 | 471 | <property name="alignment"> | ||
401 | 472 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
402 | 473 | </property> | ||
403 | 474 | </widget> | ||
404 | 475 | </item> | ||
405 | 476 | </layout> | ||
406 | 477 | </item> | ||
407 | 478 | <item row="4" column="1"> | ||
408 | 479 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
409 | 480 | <property name="leftMargin"> | ||
410 | 481 | <number>10</number> | ||
411 | 482 | </property> | ||
412 | 483 | <item> | ||
413 | 484 | <widget class="QLabel" name="confirm_email_assistance"> | ||
414 | 485 | <property name="sizePolicy"> | ||
415 | 486 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
416 | 487 | <horstretch>0</horstretch> | ||
417 | 488 | <verstretch>0</verstretch> | ||
418 | 489 | </sizepolicy> | ||
419 | 490 | </property> | ||
420 | 491 | <property name="maximumSize"> | ||
421 | 492 | <size> | ||
422 | 493 | <width>300</width> | ||
423 | 494 | <height>16777215</height> | ||
424 | 495 | </size> | ||
425 | 496 | </property> | ||
426 | 497 | <property name="text"> | ||
427 | 498 | <string>confirm_email_assistance</string> | ||
428 | 499 | </property> | ||
429 | 500 | <property name="alignment"> | ||
430 | 501 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
431 | 502 | </property> | ||
432 | 503 | </widget> | ||
433 | 504 | </item> | ||
434 | 505 | </layout> | ||
435 | 506 | </item> | ||
436 | 507 | <item row="6" column="1" rowspan="2"> | ||
437 | 508 | <widget class="QLabel" name="password_assistance"> | ||
438 | 509 | <property name="sizePolicy"> | ||
439 | 510 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
440 | 511 | <horstretch>0</horstretch> | ||
441 | 512 | <verstretch>0</verstretch> | ||
442 | 513 | </sizepolicy> | ||
443 | 514 | </property> | ||
444 | 515 | <property name="maximumSize"> | ||
445 | 516 | <size> | ||
446 | 517 | <width>300</width> | ||
447 | 518 | <height>16777215</height> | ||
448 | 519 | </size> | ||
449 | 520 | </property> | ||
450 | 521 | <property name="text"> | ||
451 | 522 | <string>password_assistance</string> | ||
452 | 523 | </property> | ||
453 | 524 | <property name="indent"> | ||
454 | 525 | <number>20</number> | ||
455 | 526 | </property> | ||
456 | 527 | </widget> | ||
457 | 528 | </item> | ||
458 | 529 | <item row="2" column="1"> | ||
459 | 530 | <spacer name="verticalSpacer"> | ||
460 | 531 | <property name="orientation"> | ||
461 | 532 | <enum>Qt::Vertical</enum> | ||
462 | 533 | </property> | ||
463 | 534 | <property name="sizeType"> | ||
464 | 535 | <enum>QSizePolicy::Fixed</enum> | ||
465 | 536 | </property> | ||
466 | 537 | <property name="sizeHint" stdset="0"> | ||
467 | 538 | <size> | ||
468 | 539 | <width>20</width> | ||
469 | 540 | <height>20</height> | ||
470 | 541 | </size> | ||
471 | 542 | </property> | ||
472 | 543 | </spacer> | ||
473 | 544 | </item> | ||
474 | 545 | <item row="5" column="1"> | ||
475 | 546 | <spacer name="verticalSpacer_2"> | ||
476 | 547 | <property name="orientation"> | ||
477 | 548 | <enum>Qt::Vertical</enum> | ||
478 | 549 | </property> | ||
479 | 550 | <property name="sizeType"> | ||
480 | 551 | <enum>QSizePolicy::Fixed</enum> | ||
481 | 552 | </property> | ||
482 | 553 | <property name="sizeHint" stdset="0"> | ||
483 | 554 | <size> | ||
484 | 555 | <width>20</width> | ||
485 | 556 | <height>20</height> | ||
486 | 557 | </size> | ||
487 | 558 | </property> | ||
488 | 559 | </spacer> | ||
489 | 560 | </item> | ||
490 | 325 | </layout> | 561 | </layout> |
491 | 326 | </item> | 562 | </item> |
492 | 327 | <item> | 563 | <item> |
493 | 328 | 564 | ||
494 | === modified file 'data/qt/ubuntuone.qss' | |||
495 | --- data/qt/ubuntuone.qss 2011-08-17 14:34:27 +0000 | |||
496 | +++ data/qt/ubuntuone.qss 2011-08-22 14:08:26 +0000 | |||
497 | @@ -18,9 +18,6 @@ | |||
498 | 18 | background-color: white; | 18 | background-color: white; |
499 | 19 | } | 19 | } |
500 | 20 | 20 | ||
501 | 21 | QLabel#name_assistance, | ||
502 | 22 | QLabel#email_assistance, | ||
503 | 23 | QLabel#confirm_email_assistance, | ||
504 | 24 | QLabel#password_assistance, | 21 | QLabel#password_assistance, |
505 | 25 | QLabel#refresh_label{ | 22 | QLabel#refresh_label{ |
506 | 26 | border-image: url(":/balloon_shape.png"); | 23 | border-image: url(":/balloon_shape.png"); |
507 | @@ -174,3 +171,11 @@ | |||
508 | 174 | font: bold 14px; | 171 | font: bold 14px; |
509 | 175 | color: #dd4814; | 172 | color: #dd4814; |
510 | 176 | } | 173 | } |
511 | 174 | |||
512 | 175 | QLineEdit[formError="true"]{ | ||
513 | 176 | background-color: #ffe5e5; | ||
514 | 177 | } | ||
515 | 178 | |||
516 | 179 | QLineEdit[formError="false"]{ | ||
517 | 180 | background-color: white; | ||
518 | 181 | } | ||
519 | 177 | 182 | ||
520 | === modified file 'ubuntuone_installer/gui/qt/setup_account.py' | |||
521 | --- ubuntuone_installer/gui/qt/setup_account.py 2011-08-08 21:48:11 +0000 | |||
522 | +++ ubuntuone_installer/gui/qt/setup_account.py 2011-08-22 14:08:26 +0000 | |||
523 | @@ -21,15 +21,17 @@ | |||
524 | 21 | import gettext | 21 | import gettext |
525 | 22 | import re | 22 | import re |
526 | 23 | 23 | ||
528 | 24 | from PyQt4 import QtGui | 24 | from PyQt4 import QtGui, QtCore |
529 | 25 | 25 | ||
530 | 26 | from ubuntu_sso.qt import gui as sso_gui | 26 | from ubuntu_sso.qt import gui as sso_gui |
531 | 27 | 27 | ||
532 | 28 | _ = gettext.gettext | 28 | _ = gettext.gettext |
533 | 29 | 29 | ||
534 | 30 | # pylint: disable=C0103 | 30 | # pylint: disable=C0103 |
537 | 31 | BAD = u'<img src=":/password_hint_warning.png" /><font color="red"> %s </font>' | 31 | BAD = u'<img src=":/password_hint_warning.png" /><font> %s </font>' |
538 | 32 | GOOD = u'<img src=":/password_hint_ok.png" /><font color="green"> %s </font>' | 32 | ERROR = u'<font color="#dd4814"><b> %s </b></font>' |
539 | 33 | GOOD = u'<img src=":/password_hint_ok.png" /><font> %s </font>' | ||
540 | 34 | NORMAL = u'<font> %s </font>' | ||
541 | 33 | TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>" | 35 | TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>" |
542 | 34 | 36 | ||
543 | 35 | EMPTY_NAME = _("Please enter your name") | 37 | EMPTY_NAME = _("Please enter your name") |
544 | @@ -42,8 +44,19 @@ | |||
545 | 42 | 44 | ||
546 | 43 | 45 | ||
547 | 44 | class SetupAccountPage(sso_gui.SetupAccountPage): | 46 | class SetupAccountPage(sso_gui.SetupAccountPage): |
548 | 47 | """Customized Setup Account page for SSO.""" | ||
549 | 45 | 48 | ||
551 | 46 | """Customized Setup Account page for SSO""" | 49 | def __init__(self, *args, **kwargs): |
552 | 50 | super(SetupAccountPage, self).__init__(*args, **kwargs) | ||
553 | 51 | self.ui.name_edit.textEdited.connect(self.name_assistance) | ||
554 | 52 | self.ui.email_edit.textEdited.connect(self.email_assistance) | ||
555 | 53 | self.ui.email_edit.textEdited.connect(self.confirm_email_assistance) | ||
556 | 54 | self.ui.confirm_email_edit.textEdited.connect( | ||
557 | 55 | self.confirm_email_assistance) | ||
558 | 56 | self.ui.password_edit.textEdited.connect( | ||
559 | 57 | lambda: self.password_assistance(NORMAL)) | ||
560 | 58 | self.ui.confirm_password_edit.textEdited.connect( | ||
561 | 59 | self.password_assistance) | ||
562 | 47 | 60 | ||
563 | 48 | # Invalid name "initializePage" | 61 | # Invalid name "initializePage" |
564 | 49 | # pylint: disable=C0103 | 62 | # pylint: disable=C0103 |
565 | @@ -73,75 +86,107 @@ | |||
566 | 73 | QtGui.QWizard.BackButton, | 86 | QtGui.QWizard.BackButton, |
567 | 74 | QtGui.QWizard.Stretch]) | 87 | QtGui.QWizard.Stretch]) |
568 | 75 | 88 | ||
581 | 76 | self.ui.name_edit.textEdited.connect(self.name_assistance) | 89 | self.password_default_assistance() |
582 | 77 | self.name_assistance() | 90 | # Hide assistance labels by default |
583 | 78 | self.ui.email_edit.textEdited.connect(self.email_assistance) | 91 | self.ui.name_assistance.setVisible(False) |
584 | 79 | self.ui.email_edit.textEdited.connect(self.confirm_email_assistance) | 92 | self.ui.email_assistance.setVisible(False) |
585 | 80 | self.email_assistance() | 93 | self.ui.confirm_email_assistance.setVisible(False) |
586 | 81 | self.ui.confirm_email_edit.textEdited.connect( | 94 | self.ui.password_assistance.setVisible(False) |
587 | 82 | self.confirm_email_assistance) | 95 | self.ui.refresh_label.setVisible(True) |
588 | 83 | self.confirm_email_assistance() | 96 | |
589 | 84 | self.ui.password_edit.textEdited.connect(self.password_assistance) | 97 | def focus_changed(self, old, now): |
590 | 85 | self.ui.confirm_password_edit.textEdited.connect( | 98 | """Check who has the focus to activate password popups if necessary.""" |
591 | 86 | self.password_assistance) | 99 | if now == self.ui.password_edit: |
592 | 87 | self.password_assistance() | 100 | self.ui.password_assistance.setVisible(True) |
593 | 101 | elif old == self.ui.password_edit or \ | ||
594 | 102 | now == self.ui.confirm_password_edit: | ||
595 | 103 | self.ui.password_assistance.setVisible(True) | ||
596 | 104 | self.password_assistance() | ||
597 | 88 | 105 | ||
598 | 89 | def name_assistance(self): | 106 | def name_assistance(self): |
599 | 90 | """Show help for the name field.""" | 107 | """Show help for the name field.""" |
600 | 91 | text = unicode(self.ui.name_edit.text()) | 108 | text = unicode(self.ui.name_edit.text()) |
601 | 92 | if not text.strip(): | 109 | if not text.strip(): |
602 | 93 | self.ui.name_assistance.setVisible(True) | 110 | self.ui.name_assistance.setVisible(True) |
604 | 94 | self.ui.name_assistance.setText(BAD % EMPTY_NAME) | 111 | self.ui.name_assistance.setText(ERROR % EMPTY_NAME) |
605 | 112 | self.check_as_invalid(self.ui.name_edit) | ||
606 | 95 | else: | 113 | else: |
607 | 96 | self.ui.name_assistance.setVisible(False) | 114 | self.ui.name_assistance.setVisible(False) |
608 | 115 | self.check_as_valid(self.ui.name_edit) | ||
609 | 97 | 116 | ||
610 | 98 | def email_assistance(self): | 117 | def email_assistance(self): |
611 | 99 | """Show help for the email field.""" | 118 | """Show help for the email field.""" |
612 | 100 | text = unicode(self.ui.email_edit.text()) | 119 | text = unicode(self.ui.email_edit.text()) |
613 | 101 | if not is_correct_email(text): | 120 | if not is_correct_email(text): |
615 | 102 | self.ui.email_assistance.setText(BAD % INVALID_EMAIL) | 121 | self.ui.email_assistance.setText(ERROR % INVALID_EMAIL) |
616 | 103 | self.ui.email_assistance.setVisible(True) | 122 | self.ui.email_assistance.setVisible(True) |
617 | 123 | self.check_as_invalid(self.ui.email_edit) | ||
618 | 104 | else: | 124 | else: |
619 | 105 | self.ui.email_assistance.setVisible(False) | 125 | self.ui.email_assistance.setVisible(False) |
620 | 126 | self.check_as_valid(self.ui.email_edit) | ||
621 | 106 | 127 | ||
622 | 107 | def confirm_email_assistance(self): | 128 | def confirm_email_assistance(self): |
623 | 108 | """Show help for the confirm email field.""" | 129 | """Show help for the confirm email field.""" |
624 | 109 | text1 = unicode(self.ui.email_edit.text()) | 130 | text1 = unicode(self.ui.email_edit.text()) |
625 | 110 | text2 = unicode(self.ui.confirm_email_edit.text()) | 131 | text2 = unicode(self.ui.confirm_email_edit.text()) |
626 | 111 | if text1 != text2: | 132 | if text1 != text2: |
628 | 112 | self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH) | 133 | self.ui.confirm_email_assistance.setText(ERROR % EMAIL_MATCH) |
629 | 113 | self.ui.confirm_email_assistance.setVisible(True) | 134 | self.ui.confirm_email_assistance.setVisible(True) |
630 | 135 | self.check_as_invalid(self.ui.confirm_email_edit) | ||
631 | 114 | else: | 136 | else: |
632 | 115 | self.ui.confirm_email_assistance.setVisible(False) | 137 | self.ui.confirm_email_assistance.setVisible(False) |
633 | 138 | self.check_as_valid(self.ui.confirm_email_edit) | ||
634 | 116 | 139 | ||
636 | 117 | def password_assistance(self): | 140 | def password_assistance(self, icon_type=BAD): |
637 | 118 | """Show help for the password field.""" | 141 | """Show help for the password field.""" |
638 | 119 | text1 = unicode(self.ui.password_edit.text()) | 142 | text1 = unicode(self.ui.password_edit.text()) |
639 | 120 | text2 = unicode(self.ui.confirm_password_edit.text()) | 143 | text2 = unicode(self.ui.confirm_password_edit.text()) |
640 | 121 | label_text = ["<b>%s</b>" % _("Your password must contain"), ] | 144 | label_text = ["<b>%s</b>" % _("Your password must contain"), ] |
641 | 122 | 145 | ||
642 | 123 | if len(text1) < 8: | 146 | if len(text1) < 8: |
644 | 124 | sign = BAD | 147 | sign = icon_type |
645 | 125 | else: | 148 | else: |
646 | 126 | sign = GOOD | 149 | sign = GOOD |
647 | 127 | label_text.append(sign % PASSWORD_LENGTH) | 150 | label_text.append(sign % PASSWORD_LENGTH) |
648 | 128 | 151 | ||
649 | 129 | if re.search('[A-Z]', text1) is None: | 152 | if re.search('[A-Z]', text1) is None: |
651 | 130 | sign = BAD | 153 | sign = icon_type |
652 | 131 | else: | 154 | else: |
653 | 132 | sign = GOOD | 155 | sign = GOOD |
654 | 133 | label_text.append(sign % PASSWORD_UPPER) | 156 | label_text.append(sign % PASSWORD_UPPER) |
655 | 134 | 157 | ||
656 | 135 | if re.search('[\d+]', text1) is None: | 158 | if re.search('[\d+]', text1) is None: |
658 | 136 | sign = BAD | 159 | sign = icon_type |
659 | 137 | else: | 160 | else: |
660 | 138 | sign = GOOD | 161 | sign = GOOD |
661 | 139 | label_text.append(sign % PASSWORD_DIGIT) | 162 | label_text.append(sign % PASSWORD_DIGIT) |
662 | 140 | 163 | ||
663 | 141 | if text1 != text2: | 164 | if text1 != text2: |
667 | 142 | label_text.append(BAD % PASSWORD_MATCH) | 165 | label_text.append(icon_type % PASSWORD_MATCH) |
668 | 143 | 166 | ||
669 | 144 | self.ui.password_assistance.setText("<br>".join(label_text)) | 167 | self.ui.password_assistance.setText("<br>".join(label_text)) |
670 | 168 | |||
671 | 169 | def password_default_assistance(self): | ||
672 | 170 | """Show default help for the password field.""" | ||
673 | 171 | label_text = ["<b>%s</b>" % _("Your password must contain"), ] | ||
674 | 172 | |||
675 | 173 | label_text.append(NORMAL % PASSWORD_LENGTH) | ||
676 | 174 | label_text.append(NORMAL % PASSWORD_UPPER) | ||
677 | 175 | label_text.append(NORMAL % PASSWORD_DIGIT) | ||
678 | 176 | |||
679 | 177 | self.ui.password_assistance.setText("<br>".join(label_text)) | ||
680 | 178 | |||
681 | 179 | def check_as_invalid(self, line_edit): | ||
682 | 180 | """Set QLineEdit's formError property as True, refresh the style.""" | ||
683 | 181 | line_edit.setProperty("formError", True) | ||
684 | 182 | line_edit.style().unpolish(line_edit) | ||
685 | 183 | line_edit.style().polish(line_edit) | ||
686 | 184 | |||
687 | 185 | def check_as_valid(self, line_edit): | ||
688 | 186 | """Set QLineEdit's formError property as False, refresh the style.""" | ||
689 | 187 | line_edit.setProperty("formError", False) | ||
690 | 188 | line_edit.style().unpolish(line_edit) | ||
691 | 189 | line_edit.style().polish(line_edit) | ||
692 | 145 | 190 | ||
693 | 146 | def showEvent(self, event): | 191 | def showEvent(self, event): |
694 | 147 | """Set set_up_button as default button when the page is shown.""" | 192 | """Set set_up_button as default button when the page is shown.""" |
695 | @@ -151,6 +196,18 @@ | |||
696 | 151 | self.ui.set_up_button.setProperty("DisabledState", True) | 196 | self.ui.set_up_button.setProperty("DisabledState", True) |
697 | 152 | self.ui.set_up_button.style().unpolish(self.ui.set_up_button) | 197 | self.ui.set_up_button.style().unpolish(self.ui.set_up_button) |
698 | 153 | self.ui.set_up_button.style().polish(self.ui.set_up_button) | 198 | self.ui.set_up_button.style().polish(self.ui.set_up_button) |
699 | 199 | self.connect(QtGui.QApplication.instance(), | ||
700 | 200 | QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"), | ||
701 | 201 | self.focus_changed) | ||
702 | 202 | |||
703 | 203 | def hideEvent(self, event): | ||
704 | 204 | """Disconnect the focusChanged signal when the page change.""" | ||
705 | 205 | try: | ||
706 | 206 | self.disconnect(QtGui.QApplication.instance(), | ||
707 | 207 | QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"), | ||
708 | 208 | self.focus_changed) | ||
709 | 209 | except TypeError: | ||
710 | 210 | pass | ||
711 | 154 | 211 | ||
712 | 155 | 212 | ||
713 | 156 | def is_min_required_password(password): | 213 | def is_min_required_password(password): |
714 | 157 | 214 | ||
715 | === modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py' | |||
716 | --- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-08-17 13:34:23 +0000 | |||
717 | +++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-08-22 14:08:26 +0000 | |||
718 | @@ -371,8 +371,8 @@ | |||
719 | 371 | gui.sys.frozen = True | 371 | gui.sys.frozen = True |
720 | 372 | self.patch(gui.subprocess, "Popen", self._set_called) | 372 | self.patch(gui.subprocess, "Popen", self._set_called) |
721 | 373 | self.ui.done(result=1) | 373 | self.ui.done(result=1) |
724 | 374 | self.assertTrue(os.sep in self._called[0][0][0]) | 374 | self.assertIn(os.sep, self._called[0][0][0]) |
725 | 375 | self.assertTrue('ubuntuone-control-panel-qt' in self._called[0][0][0]) | 375 | self.assertIn('ubuntuone-control-panel-qt', self._called[0][0][0]) |
726 | 376 | 376 | ||
727 | 377 | def test_not_start_control_panel_on_cancel(self): | 377 | def test_not_start_control_panel_on_cancel(self): |
728 | 378 | """Called done with result=0, control panel should NOT be called.""" | 378 | """Called done with result=0, control panel should NOT be called.""" |
729 | @@ -636,7 +636,7 @@ | |||
730 | 636 | u"Space (1337)") | 636 | u"Space (1337)") |
731 | 637 | 637 | ||
732 | 638 | def test_add_twice(self): | 638 | def test_add_twice(self): |
734 | 639 | """Behaviour for adding the same folder twice: | 639 | """Behaviour for adding the same folder twice. |
735 | 640 | 640 | ||
736 | 641 | * It's added only once. | 641 | * It's added only once. |
737 | 642 | """ | 642 | """ |
738 | @@ -649,7 +649,7 @@ | |||
739 | 649 | self.assertEqual(1, self.ui.ui.folder_list.topLevelItemCount()) | 649 | self.assertEqual(1, self.ui.ui.folder_list.topLevelItemCount()) |
740 | 650 | 650 | ||
741 | 651 | def test_add_missing_folder(self): | 651 | def test_add_missing_folder(self): |
743 | 652 | """Behaviour for adding a folder that doesn't exist: | 652 | """Behaviour for adding a folder that doesn't exist. |
744 | 653 | 653 | ||
745 | 654 | * It's added. | 654 | * It's added. |
746 | 655 | * Has size 0. | 655 | * Has size 0. |
747 | @@ -687,6 +687,21 @@ | |||
748 | 687 | 'see bug #824675 for reference.' | 687 | 'see bug #824675 for reference.' |
749 | 688 | 688 | ||
750 | 689 | 689 | ||
751 | 690 | class FakeWizard(object): | ||
752 | 691 | """Replace wizard() function on wizard pages.""" | ||
753 | 692 | |||
754 | 693 | params = None | ||
755 | 694 | |||
756 | 695 | # Invalid name "setButtonLayout" | ||
757 | 696 | # pylint: disable=C0103 | ||
758 | 697 | |||
759 | 698 | def setButtonLayout(self, *args, **kwargs): | ||
760 | 699 | """Fake the functionality of setButtonLayout on QWizard class.""" | ||
761 | 700 | FakeWizard.params = (args, kwargs) | ||
762 | 701 | |||
763 | 702 | # pylint: enable=C0103 | ||
764 | 703 | |||
765 | 704 | |||
766 | 690 | class SetupAccountTestCase(BaseTestCase): | 705 | class SetupAccountTestCase(BaseTestCase): |
767 | 691 | """Test the SetupAccountPage code.""" | 706 | """Test the SetupAccountPage code.""" |
768 | 692 | 707 | ||
769 | @@ -701,11 +716,37 @@ | |||
770 | 701 | """Initialize this test instance.""" | 716 | """Initialize this test instance.""" |
771 | 702 | super(SetupAccountTestCase, self).setUp() | 717 | super(SetupAccountTestCase, self).setUp() |
772 | 703 | 718 | ||
773 | 719 | def test_init(self): | ||
774 | 720 | """Check the initial state of SetupAccount.""" | ||
775 | 721 | self.assertEqual(self.ui.ui.name_edit.receivers( | ||
776 | 722 | QtCore.SIGNAL('textEdited(QString)')), 1) | ||
777 | 723 | self.assertEqual(self.ui.ui.email_edit.receivers( | ||
778 | 724 | QtCore.SIGNAL('textEdited(QString)')), 2) | ||
779 | 725 | self.assertEqual(self.ui.ui.confirm_email_edit.receivers( | ||
780 | 726 | QtCore.SIGNAL('textEdited(QString)')), 1) | ||
781 | 727 | self.assertEqual(self.ui.ui.password_edit.receivers( | ||
782 | 728 | QtCore.SIGNAL('textEdited(QString)')), 1) | ||
783 | 729 | self.assertEqual(self.ui.ui.confirm_password_edit.receivers( | ||
784 | 730 | QtCore.SIGNAL('textEdited(QString)')), 1) | ||
785 | 731 | |||
786 | 732 | def test_initialize_page(self): | ||
787 | 733 | """Check the initializePage to ensure proper widgets visibility.""" | ||
788 | 734 | self.ui.show() | ||
789 | 735 | self.patch(self.ui, 'wizard', FakeWizard) | ||
790 | 736 | self.ui.initializePage() | ||
791 | 737 | self.assertEqual(FakeWizard.params, (([ | ||
792 | 738 | QtGui.QWizard.BackButton, | ||
793 | 739 | QtGui.QWizard.Stretch],), {})) | ||
794 | 740 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) | ||
795 | 741 | self.assertFalse(self.ui.ui.email_assistance.isVisible()) | ||
796 | 742 | self.assertFalse(self.ui.ui.confirm_email_assistance.isVisible()) | ||
797 | 743 | self.assertFalse(self.ui.ui.password_assistance.isVisible()) | ||
798 | 744 | |||
799 | 704 | def test_empty_name(self): | 745 | def test_empty_name(self): |
801 | 705 | """Status when the name field is empty: | 746 | """Status when the name field is empty. |
802 | 706 | 747 | ||
805 | 707 | * Name Assistance label visible | 748 | * Name Assistance label visible. |
806 | 708 | * Correct error message in it | 749 | * Correct error message in it. |
807 | 709 | """ | 750 | """ |
808 | 710 | self.ui.ui.name_edit.setText("") | 751 | self.ui.ui.name_edit.setText("") |
809 | 711 | self.ui.name_assistance() | 752 | self.ui.name_assistance() |
810 | @@ -713,14 +754,14 @@ | |||
811 | 713 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) | 754 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) |
812 | 714 | self.assertEqual( | 755 | self.assertEqual( |
813 | 715 | unicode(self.ui.ui.name_assistance.text()), | 756 | unicode(self.ui.ui.name_assistance.text()), |
815 | 716 | setup_account.BAD % setup_account.EMPTY_NAME) | 757 | setup_account.ERROR % setup_account.EMPTY_NAME) |
816 | 717 | self.ui.hide() | 758 | self.ui.hide() |
817 | 718 | 759 | ||
818 | 719 | def test_blank_name(self): | 760 | def test_blank_name(self): |
820 | 720 | """Status when the name field is blank (spaces): | 761 | """Status when the name field is blank (spaces). |
821 | 721 | 762 | ||
824 | 722 | * Name Assistance label visible | 763 | * Name Assistance label visible. |
825 | 723 | * Correct error message in it | 764 | * Correct error message in it. |
826 | 724 | """ | 765 | """ |
827 | 725 | self.ui.ui.name_edit.setText(" ") | 766 | self.ui.ui.name_edit.setText(" ") |
828 | 726 | self.ui.name_assistance() | 767 | self.ui.name_assistance() |
829 | @@ -728,13 +769,13 @@ | |||
830 | 728 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) | 769 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) |
831 | 729 | self.assertEqual( | 770 | self.assertEqual( |
832 | 730 | unicode(self.ui.ui.name_assistance.text()), | 771 | unicode(self.ui.ui.name_assistance.text()), |
834 | 731 | setup_account.BAD % setup_account.EMPTY_NAME) | 772 | setup_account.ERROR % setup_account.EMPTY_NAME) |
835 | 732 | self.ui.hide() | 773 | self.ui.hide() |
836 | 733 | 774 | ||
837 | 734 | def test_valid_name(self): | 775 | def test_valid_name(self): |
839 | 735 | """Status when the name field is valid: | 776 | """Status when the name field is valid. |
840 | 736 | 777 | ||
842 | 737 | * Name Assistance label invisible | 778 | * Name Assistance label invisible. |
843 | 738 | """ | 779 | """ |
844 | 739 | self.ui.ui.name_edit.setText("John Doe") | 780 | self.ui.ui.name_edit.setText("John Doe") |
845 | 740 | self.ui.name_assistance() | 781 | self.ui.name_assistance() |
846 | @@ -743,10 +784,10 @@ | |||
847 | 743 | self.ui.hide() | 784 | self.ui.hide() |
848 | 744 | 785 | ||
849 | 745 | def test_invalid_email(self): | 786 | def test_invalid_email(self): |
851 | 746 | """Status when the email field has no @: | 787 | """Status when the email field has no @. |
852 | 747 | 788 | ||
855 | 748 | * Email Assistance label visible | 789 | * Email Assistance label visible. |
856 | 749 | * Correct error message in it | 790 | * Correct error message in it. |
857 | 750 | """ | 791 | """ |
858 | 751 | self.ui.ui.email_edit.setText("foobar") | 792 | self.ui.ui.email_edit.setText("foobar") |
859 | 752 | self.ui.email_assistance() | 793 | self.ui.email_assistance() |
860 | @@ -754,13 +795,13 @@ | |||
861 | 754 | self.assertEqual(self.ui.ui.email_assistance.isVisible(), True) | 795 | self.assertEqual(self.ui.ui.email_assistance.isVisible(), True) |
862 | 755 | self.assertEqual( | 796 | self.assertEqual( |
863 | 756 | unicode(self.ui.ui.email_assistance.text()), | 797 | unicode(self.ui.ui.email_assistance.text()), |
865 | 757 | setup_account.BAD % setup_account.INVALID_EMAIL) | 798 | setup_account.ERROR % setup_account.INVALID_EMAIL) |
866 | 758 | self.ui.hide() | 799 | self.ui.hide() |
867 | 759 | 800 | ||
868 | 760 | def test_valid_email(self): | 801 | def test_valid_email(self): |
870 | 761 | """Status when the email field has a @: | 802 | """Status when the email field has a @. |
871 | 762 | 803 | ||
873 | 763 | * Email Assistance label invisible | 804 | * Email Assistance label invisible. |
874 | 764 | """ | 805 | """ |
875 | 765 | self.ui.ui.email_edit.setText("foo@bar") | 806 | self.ui.ui.email_edit.setText("foo@bar") |
876 | 766 | self.ui.email_assistance() | 807 | self.ui.email_assistance() |
877 | @@ -769,9 +810,9 @@ | |||
878 | 769 | self.ui.hide() | 810 | self.ui.hide() |
879 | 770 | 811 | ||
880 | 771 | def test_matching_emails(self): | 812 | def test_matching_emails(self): |
882 | 772 | """Status when the email fields match: | 813 | """Status when the email fields match. |
883 | 773 | 814 | ||
885 | 774 | * Email Assistance label invisible | 815 | * Email Assistance label invisible. |
886 | 775 | """ | 816 | """ |
887 | 776 | self.ui.ui.email_edit.setText("foo@bar") | 817 | self.ui.ui.email_edit.setText("foo@bar") |
888 | 777 | self.ui.ui.confirm_email_edit.setText("foo@bar") | 818 | self.ui.ui.confirm_email_edit.setText("foo@bar") |
889 | @@ -782,10 +823,10 @@ | |||
890 | 782 | self.ui.hide() | 823 | self.ui.hide() |
891 | 783 | 824 | ||
892 | 784 | def test_not_matching_emails(self): | 825 | def test_not_matching_emails(self): |
894 | 785 | """Status when the email fields don't match: | 826 | """Status when the email fields don't match. |
895 | 786 | 827 | ||
898 | 787 | * Email Assistance label visible | 828 | * Email Assistance label visible. |
899 | 788 | * Correct error message | 829 | * Correct error message. |
900 | 789 | """ | 830 | """ |
901 | 790 | self.ui.ui.email_edit.setText("foo@bar") | 831 | self.ui.ui.email_edit.setText("foo@bar") |
902 | 791 | self.ui.ui.confirm_email_edit.setText("foo@baz") | 832 | self.ui.ui.confirm_email_edit.setText("foo@baz") |
903 | @@ -794,112 +835,214 @@ | |||
904 | 794 | self.assertEqual(self.ui.ui.confirm_email_assistance.isVisible(), True) | 835 | self.assertEqual(self.ui.ui.confirm_email_assistance.isVisible(), True) |
905 | 795 | self.assertEqual( | 836 | self.assertEqual( |
906 | 796 | unicode(self.ui.ui.confirm_email_assistance.text()), | 837 | unicode(self.ui.ui.confirm_email_assistance.text()), |
908 | 797 | setup_account.BAD % setup_account.EMAIL_MATCH) | 838 | setup_account.ERROR % setup_account.EMAIL_MATCH) |
909 | 798 | self.ui.hide() | 839 | self.ui.hide() |
910 | 799 | 840 | ||
911 | 800 | def test_short_password(self): | 841 | def test_short_password(self): |
913 | 801 | """Status with short password: | 842 | """Status with short password. |
914 | 802 | 843 | ||
916 | 803 | * Password assistance contains the right message | 844 | * Password assistance contains the right message. |
917 | 804 | """ | 845 | """ |
918 | 805 | self.ui.ui.password_edit.setText("foobar") | 846 | self.ui.ui.password_edit.setText("foobar") |
919 | 806 | self.ui.password_assistance() | 847 | self.ui.password_assistance() |
923 | 807 | self.assertEqual( | 848 | self.assertIn( |
924 | 808 | True, | 849 | setup_account.BAD % setup_account.PASSWORD_LENGTH, |
922 | 809 | setup_account.BAD % setup_account.PASSWORD_LENGTH in | ||
925 | 810 | unicode(self.ui.ui.password_assistance.text()), | 850 | unicode(self.ui.ui.password_assistance.text()), |
926 | 811 | ) | 851 | ) |
927 | 812 | 852 | ||
928 | 813 | def test_long_password(self): | 853 | def test_long_password(self): |
930 | 814 | """Status with long password: | 854 | """Status with long password. |
931 | 815 | 855 | ||
933 | 816 | * Password assistance contains the right message | 856 | * Password assistance contains the right message. |
934 | 817 | """ | 857 | """ |
935 | 818 | self.ui.ui.password_edit.setText("foobarbaz") | 858 | self.ui.ui.password_edit.setText("foobarbaz") |
936 | 819 | self.ui.password_assistance() | 859 | self.ui.password_assistance() |
940 | 820 | self.assertEqual( | 860 | self.assertIn( |
941 | 821 | True, | 861 | setup_account.GOOD % setup_account.PASSWORD_LENGTH, |
939 | 822 | setup_account.GOOD % setup_account.PASSWORD_LENGTH in | ||
942 | 823 | unicode(self.ui.ui.password_assistance.text()), | 862 | unicode(self.ui.ui.password_assistance.text()), |
943 | 824 | ) | 863 | ) |
944 | 825 | 864 | ||
945 | 826 | def test_no_number_password(self): | 865 | def test_no_number_password(self): |
947 | 827 | """Status with password without a number: | 866 | """Status with password without a number. |
948 | 828 | 867 | ||
950 | 829 | * Password assistance contains the right message | 868 | * Password assistance contains the right message. |
951 | 830 | """ | 869 | """ |
952 | 831 | self.ui.ui.password_edit.setText("foobarbaz") | 870 | self.ui.ui.password_edit.setText("foobarbaz") |
953 | 832 | self.ui.password_assistance() | 871 | self.ui.password_assistance() |
957 | 833 | self.assertEqual( | 872 | self.assertIn( |
958 | 834 | True, | 873 | setup_account.BAD % setup_account.PASSWORD_DIGIT, |
956 | 835 | setup_account.BAD % setup_account.PASSWORD_DIGIT in | ||
959 | 836 | unicode(self.ui.ui.password_assistance.text()), | 874 | unicode(self.ui.ui.password_assistance.text()), |
960 | 837 | ) | 875 | ) |
961 | 838 | 876 | ||
962 | 839 | def test_number_password(self): | 877 | def test_number_password(self): |
964 | 840 | """Status with password with a number: | 878 | """Status with password with a number. |
965 | 841 | 879 | ||
967 | 842 | * Password assistance contains the right message | 880 | * Password assistance contains the right message. |
968 | 843 | """ | 881 | """ |
969 | 844 | self.ui.ui.password_edit.setText("foobarba7") | 882 | self.ui.ui.password_edit.setText("foobarba7") |
970 | 845 | self.ui.password_assistance() | 883 | self.ui.password_assistance() |
974 | 846 | self.assertEqual( | 884 | self.assertIn( |
975 | 847 | True, | 885 | setup_account.GOOD % setup_account.PASSWORD_DIGIT, |
973 | 848 | setup_account.GOOD % setup_account.PASSWORD_DIGIT in | ||
976 | 849 | unicode(self.ui.ui.password_assistance.text()), | 886 | unicode(self.ui.ui.password_assistance.text()), |
977 | 850 | ) | 887 | ) |
978 | 851 | 888 | ||
979 | 852 | def test_no_uppercase_password(self): | 889 | def test_no_uppercase_password(self): |
981 | 853 | """Status with password without uppercase letters: | 890 | """Status with password without uppercase letters. |
982 | 854 | 891 | ||
984 | 855 | * Password assistance contains the right message | 892 | * Password assistance contains the right message. |
985 | 856 | """ | 893 | """ |
986 | 857 | self.ui.ui.password_edit.setText("foobarbaz") | 894 | self.ui.ui.password_edit.setText("foobarbaz") |
987 | 858 | self.ui.password_assistance() | 895 | self.ui.password_assistance() |
991 | 859 | self.assertEqual( | 896 | self.assertIn( |
992 | 860 | True, | 897 | setup_account.BAD % setup_account.PASSWORD_UPPER, |
990 | 861 | setup_account.BAD % setup_account.PASSWORD_UPPER in | ||
993 | 862 | unicode(self.ui.ui.password_assistance.text()), | 898 | unicode(self.ui.ui.password_assistance.text()), |
994 | 863 | ) | 899 | ) |
995 | 864 | 900 | ||
996 | 865 | def test_upper_password(self): | 901 | def test_upper_password(self): |
998 | 866 | """Status with password with uppercase letters: | 902 | """Status with password with uppercase letters. |
999 | 867 | 903 | ||
1001 | 868 | * Password assistance contains the right message | 904 | * Password assistance contains the right message. |
1002 | 869 | """ | 905 | """ |
1003 | 870 | self.ui.ui.password_edit.setText("Foobarba7") | 906 | self.ui.ui.password_edit.setText("Foobarba7") |
1004 | 871 | self.ui.password_assistance() | 907 | self.ui.password_assistance() |
1008 | 872 | self.assertEqual( | 908 | self.assertIn( |
1009 | 873 | True, | 909 | setup_account.GOOD % setup_account.PASSWORD_UPPER, |
1007 | 874 | setup_account.GOOD % setup_account.PASSWORD_UPPER in | ||
1010 | 875 | unicode(self.ui.ui.password_assistance.text()), | 910 | unicode(self.ui.ui.password_assistance.text()), |
1011 | 876 | ) | 911 | ) |
1012 | 877 | 912 | ||
1013 | 878 | def test_matching_passwords(self): | 913 | def test_matching_passwords(self): |
1015 | 879 | """Status when the passwords match: | 914 | """Status when the passwords match. |
1016 | 880 | 915 | ||
1018 | 881 | * Password assistance doesn't contain the message | 916 | * Password assistance doesn't contain the message. |
1019 | 882 | """ | 917 | """ |
1020 | 883 | self.ui.ui.password_edit.setText("Foobarba7") | 918 | self.ui.ui.password_edit.setText("Foobarba7") |
1021 | 884 | self.ui.ui.confirm_password_edit.setText("Foobarba7") | 919 | self.ui.ui.confirm_password_edit.setText("Foobarba7") |
1022 | 885 | self.ui.password_assistance() | 920 | self.ui.password_assistance() |
1026 | 886 | self.assertEqual( | 921 | self.assertNotIn( |
1027 | 887 | False, | 922 | setup_account.PASSWORD_MATCH, |
1025 | 888 | setup_account.PASSWORD_MATCH in | ||
1028 | 889 | unicode(self.ui.ui.password_assistance.text()), | 923 | unicode(self.ui.ui.password_assistance.text()), |
1029 | 890 | ) | 924 | ) |
1030 | 891 | 925 | ||
1031 | 892 | def test_not_matching_passwords(self): | 926 | def test_not_matching_passwords(self): |
1033 | 893 | """Status when the passwords not match: | 927 | """Status when the passwords not match. |
1034 | 894 | 928 | ||
1036 | 895 | * Password assistance contains the right message | 929 | * Password assistance contains the right message. |
1037 | 896 | """ | 930 | """ |
1038 | 897 | self.ui.ui.password_edit.setText("Foobarba7") | 931 | self.ui.ui.password_edit.setText("Foobarba7") |
1039 | 898 | self.ui.ui.confirm_password_edit.setText("BazBarFo0") | 932 | self.ui.ui.confirm_password_edit.setText("BazBarFo0") |
1040 | 899 | self.ui.password_assistance() | 933 | self.ui.password_assistance() |
1044 | 900 | self.assertEqual( | 934 | self.assertIn( |
1045 | 901 | True, | 935 | setup_account.BAD % setup_account.PASSWORD_MATCH, |
1046 | 902 | setup_account.BAD % setup_account.PASSWORD_MATCH in | 936 | unicode(self.ui.ui.password_assistance.text()), |
1047 | 937 | ) | ||
1048 | 938 | |||
1049 | 939 | def test_password_default_assistance(self): | ||
1050 | 940 | """Status when the password line edit receive focus and shows popup. | ||
1051 | 941 | |||
1052 | 942 | * Password assistance contains the right message. | ||
1053 | 943 | """ | ||
1054 | 944 | self.ui.ui.password_edit.setText("") | ||
1055 | 945 | self.ui.ui.confirm_password_edit.setText("") | ||
1056 | 946 | self.ui.password_assistance() | ||
1057 | 947 | self.ui.focus_changed(None, self.ui.ui.password_edit) | ||
1058 | 948 | self.assertIn( | ||
1059 | 949 | setup_account.NORMAL % setup_account.PASSWORD_LENGTH, | ||
1060 | 950 | unicode(self.ui.ui.password_assistance.text()), | ||
1061 | 951 | ) | ||
1062 | 952 | self.assertIn( | ||
1063 | 953 | setup_account.NORMAL % setup_account.PASSWORD_UPPER, | ||
1064 | 954 | unicode(self.ui.ui.password_assistance.text()), | ||
1065 | 955 | ) | ||
1066 | 956 | self.assertIn( | ||
1067 | 957 | setup_account.NORMAL % setup_account.PASSWORD_DIGIT, | ||
1068 | 958 | unicode(self.ui.ui.password_assistance.text()), | ||
1069 | 959 | ) | ||
1070 | 960 | |||
1071 | 961 | def test_password_assistance_in_focus_length_correct(self): | ||
1072 | 962 | """Check the QLineEdit for password when the length is correct.""" | ||
1073 | 963 | self.ui.ui.password_edit.setText("aaaaaaaaa") | ||
1074 | 964 | self.ui.ui.confirm_password_edit.setText("") | ||
1075 | 965 | self.ui.password_assistance(setup_account.NORMAL) | ||
1076 | 966 | self.assertIn( | ||
1077 | 967 | setup_account.GOOD % setup_account.PASSWORD_LENGTH, | ||
1078 | 968 | unicode(self.ui.ui.password_assistance.text()), | ||
1079 | 969 | ) | ||
1080 | 970 | self.assertIn( | ||
1081 | 971 | setup_account.NORMAL % setup_account.PASSWORD_UPPER, | ||
1082 | 972 | unicode(self.ui.ui.password_assistance.text()), | ||
1083 | 973 | ) | ||
1084 | 974 | self.assertIn( | ||
1085 | 975 | setup_account.NORMAL % setup_account.PASSWORD_DIGIT, | ||
1086 | 976 | unicode(self.ui.ui.password_assistance.text()), | ||
1087 | 977 | ) | ||
1088 | 978 | self.assertIn( | ||
1089 | 979 | setup_account.NORMAL % setup_account.PASSWORD_MATCH, | ||
1090 | 980 | unicode(self.ui.ui.password_assistance.text()), | ||
1091 | 981 | ) | ||
1092 | 982 | |||
1093 | 983 | def test_password_assistance_in_focus_with_upper(self): | ||
1094 | 984 | """Check the QLineEdit for password when it has an upper case char.""" | ||
1095 | 985 | self.ui.ui.password_edit.setText("AAa") | ||
1096 | 986 | self.ui.ui.confirm_password_edit.setText("") | ||
1097 | 987 | self.ui.password_assistance(setup_account.NORMAL) | ||
1098 | 988 | self.assertIn( | ||
1099 | 989 | setup_account.NORMAL % setup_account.PASSWORD_LENGTH, | ||
1100 | 990 | unicode(self.ui.ui.password_assistance.text()), | ||
1101 | 991 | ) | ||
1102 | 992 | self.assertIn( | ||
1103 | 993 | setup_account.GOOD % setup_account.PASSWORD_UPPER, | ||
1104 | 994 | unicode(self.ui.ui.password_assistance.text()), | ||
1105 | 995 | ) | ||
1106 | 996 | self.assertIn( | ||
1107 | 997 | setup_account.NORMAL % setup_account.PASSWORD_DIGIT, | ||
1108 | 998 | unicode(self.ui.ui.password_assistance.text()), | ||
1109 | 999 | ) | ||
1110 | 1000 | self.assertIn( | ||
1111 | 1001 | setup_account.NORMAL % setup_account.PASSWORD_MATCH, | ||
1112 | 1002 | unicode(self.ui.ui.password_assistance.text()), | ||
1113 | 1003 | ) | ||
1114 | 1004 | |||
1115 | 1005 | def test_password_assistance_in_focus_with_number(self): | ||
1116 | 1006 | """Check the QLineEdit for password when it contains numbers.""" | ||
1117 | 1007 | self.ui.ui.password_edit.setText("a123") | ||
1118 | 1008 | self.ui.ui.confirm_password_edit.setText("") | ||
1119 | 1009 | self.ui.password_assistance(setup_account.NORMAL) | ||
1120 | 1010 | self.assertIn( | ||
1121 | 1011 | setup_account.NORMAL % setup_account.PASSWORD_LENGTH, | ||
1122 | 1012 | unicode(self.ui.ui.password_assistance.text()), | ||
1123 | 1013 | ) | ||
1124 | 1014 | self.assertIn( | ||
1125 | 1015 | setup_account.NORMAL % setup_account.PASSWORD_UPPER, | ||
1126 | 1016 | unicode(self.ui.ui.password_assistance.text()), | ||
1127 | 1017 | ) | ||
1128 | 1018 | self.assertIn( | ||
1129 | 1019 | setup_account.GOOD % setup_account.PASSWORD_DIGIT, | ||
1130 | 1020 | unicode(self.ui.ui.password_assistance.text()), | ||
1131 | 1021 | ) | ||
1132 | 1022 | self.assertIn( | ||
1133 | 1023 | setup_account.NORMAL % setup_account.PASSWORD_MATCH, | ||
1134 | 1024 | unicode(self.ui.ui.password_assistance.text()), | ||
1135 | 1025 | ) | ||
1136 | 1026 | |||
1137 | 1027 | def test_password_assistance_in_focus_all_ok(self): | ||
1138 | 1028 | """Check the QLineEdit for password when all the condition are ok.""" | ||
1139 | 1029 | self.ui.ui.password_edit.setText("T3st3rqw") | ||
1140 | 1030 | self.ui.ui.confirm_password_edit.setText("T3st3rqw") | ||
1141 | 1031 | self.ui.password_assistance(setup_account.NORMAL) | ||
1142 | 1032 | self.assertIn( | ||
1143 | 1033 | setup_account.GOOD % setup_account.PASSWORD_LENGTH, | ||
1144 | 1034 | unicode(self.ui.ui.password_assistance.text()), | ||
1145 | 1035 | ) | ||
1146 | 1036 | self.assertIn( | ||
1147 | 1037 | setup_account.GOOD % setup_account.PASSWORD_UPPER, | ||
1148 | 1038 | unicode(self.ui.ui.password_assistance.text()), | ||
1149 | 1039 | ) | ||
1150 | 1040 | self.assertIn( | ||
1151 | 1041 | setup_account.GOOD % setup_account.PASSWORD_DIGIT, | ||
1152 | 1042 | unicode(self.ui.ui.password_assistance.text()), | ||
1153 | 1043 | ) | ||
1154 | 1044 | self.assertNotIn( | ||
1155 | 1045 | setup_account.NORMAL % setup_account.PASSWORD_MATCH, | ||
1156 | 903 | unicode(self.ui.ui.password_assistance.text()), | 1046 | unicode(self.ui.ui.password_assistance.text()), |
1157 | 904 | ) | 1047 | ) |
1158 | 905 | 1048 | ||
1159 | @@ -924,6 +1067,26 @@ | |||
1160 | 924 | True, | 1067 | True, |
1161 | 925 | self.ui.sideWidget().ui.states_frame.isVisible()) | 1068 | self.ui.sideWidget().ui.states_frame.isVisible()) |
1162 | 926 | 1069 | ||
1163 | 1070 | def test_check_valid(self): | ||
1164 | 1071 | """Check the propery value of a QLineEdit marked as valid.""" | ||
1165 | 1072 | self.ui.check_as_valid(self.ui.ui.name_edit) | ||
1166 | 1073 | self.assertEqual(self.ui.ui.name_edit.property("formError"), | ||
1167 | 1074 | False) | ||
1168 | 1075 | |||
1169 | 1076 | def test_check_invalid(self): | ||
1170 | 1077 | """Check the propery value of a QLineEdit marked as invalid.""" | ||
1171 | 1078 | self.ui.check_as_invalid(self.ui.ui.name_edit) | ||
1172 | 1079 | self.assertEqual(self.ui.ui.name_edit.property("formError"), | ||
1173 | 1080 | True) | ||
1174 | 1081 | |||
1175 | 1082 | def test_focus_changed(self): | ||
1176 | 1083 | """Check visibility changes when focus_changed() is executed.""" | ||
1177 | 1084 | self.ui.show() | ||
1178 | 1085 | self.ui.focus_changed(None, self.ui.ui.password_edit) | ||
1179 | 1086 | self.assertTrue(self.ui.ui.password_assistance.isVisible()) | ||
1180 | 1087 | self.ui.focus_changed(None, self.ui.ui.captcha_solution_edit) | ||
1181 | 1088 | self.assertTrue(self.ui.ui.refresh_label.isVisible()) | ||
1182 | 1089 | |||
1183 | 927 | 1090 | ||
1184 | 928 | class FakeFailingCredentialsManagementTool(object): | 1091 | class FakeFailingCredentialsManagementTool(object): |
1185 | 929 | 1092 |
Looks great!