Skip to content

Commit 47a4ba9

Browse files
committed
Restructure test code. Assign expected value to variable.
It was hardcoded into an assert. This made tracking down the failure more difficult. Now at least I can print the two variables and diff the output.
1 parent f78ad05 commit 47a4ba9

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

test/db_test_base.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,22 +2562,24 @@ def stdoutwrite(s):
25622562
# check security output
25632563
soutput[:] = [] # empty for next round of output
25642564
tool.do_security("Admin")
2565-
self.assertEqual(soutput, [ 'New Web users get the Role "User"\n',
2566-
'New Email users get the Role "User"\n',
2567-
'Role "admin":\n',
2568-
' User may create everything (Create)\n',
2569-
' User may edit everything (Edit)\n',
2570-
' User may restore everything (Restore)\n',
2571-
' User may retire everything (Retire)\n',
2572-
' User may view everything (View)\n',
2573-
' User may access the web interface (Web Access)\n',
2574-
' User may access the rest interface (Rest Access)\n',
2575-
' User may access the xmlrpc interface (Xmlrpc Access)\n',
2576-
' User may manipulate user Roles through the web (Web Roles)\n',
2577-
' User may use the email interface (Email Access)\n',
2578-
'Role "anonymous":\n', 'Role "user":\n',
2579-
' User is allowed to access msg (View for "msg" only)\n',
2580-
' Prevent users from seeing roles (View for "user": [\'username\', \'supervisor\', \'assignable\'] only)\n'])
2565+
expected = [ 'New Web users get the Role "User"\n',
2566+
'New Email users get the Role "User"\n',
2567+
'Role "admin":\n',
2568+
' User may create everything (Create)\n',
2569+
' User may edit everything (Edit)\n',
2570+
' User may restore everything (Restore)\n',
2571+
' User may retire everything (Retire)\n',
2572+
' User may view everything (View)\n',
2573+
' User may access the web interface (Web Access)\n',
2574+
' User may access the rest interface (Rest Access)\n',
2575+
' User may access the xmlrpc interface (Xmlrpc Access)\n',
2576+
' User may manipulate user Roles through the web (Web Roles)\n',
2577+
' User may use the email interface (Email Access)\n',
2578+
'Role "anonymous":\n', 'Role "user":\n',
2579+
' User is allowed to access msg (View for "msg" only)\n',
2580+
' Prevent users from seeing roles (View for "user": [\'username\', \'supervisor\', \'assignable\'] only)\n']
2581+
2582+
self.assertEqual(soutput, expected)
25812583

25822584

25832585
self.nukeAndCreate()

0 commit comments

Comments
 (0)