diff test/db_test_base.py @ 6013:491fdb189a12

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.
author John Rouillard <rouilj@ieee.org>
date Tue, 31 Dec 2019 21:35:46 -0500
parents e9221d8ad3ba
children 15d1ce536c73
line wrap: on
line diff
--- a/test/db_test_base.py	Tue Dec 31 21:34:24 2019 -0500
+++ b/test/db_test_base.py	Tue Dec 31 21:35:46 2019 -0500
@@ -2562,22 +2562,24 @@
             # check security output
             soutput[:] = [] # empty for next round of output
             tool.do_security("Admin")
-            self.assertEqual(soutput, [ 'New Web users get the Role "User"\n',
-                                       'New Email users get the Role "User"\n',
-                                       'Role "admin":\n',
-                                       ' User may create everything (Create)\n',
-                                       ' User may edit everything (Edit)\n',
-                                       ' User may restore everything (Restore)\n',
-                                       ' User may retire everything (Retire)\n',
-                                       ' User may view everything (View)\n',
-                                       ' User may access the web interface (Web Access)\n',
-                                       ' User may access the rest interface (Rest Access)\n',
-                                       ' User may access the xmlrpc interface (Xmlrpc Access)\n',
-                                       ' User may manipulate user Roles through the web (Web Roles)\n',
-                                       ' User may use the email interface (Email Access)\n',
-                                       'Role "anonymous":\n', 'Role "user":\n',
-                                       ' User is allowed to access msg (View for "msg" only)\n',
-                                       ' Prevent users from seeing roles (View for "user": [\'username\', \'supervisor\', \'assignable\'] only)\n'])
+            expected =  [ 'New Web users get the Role "User"\n',
+                          'New Email users get the Role "User"\n',
+                          'Role "admin":\n',
+                          ' User may create everything (Create)\n',
+                          ' User may edit everything (Edit)\n',
+                          ' User may restore everything (Restore)\n',
+                          ' User may retire everything (Retire)\n',
+                          ' User may view everything (View)\n',
+                          ' User may access the web interface (Web Access)\n',
+                          ' User may access the rest interface (Rest Access)\n',
+                          ' User may access the xmlrpc interface (Xmlrpc Access)\n',
+                          ' User may manipulate user Roles through the web (Web Roles)\n',
+                          ' User may use the email interface (Email Access)\n',
+                          'Role "anonymous":\n', 'Role "user":\n',
+                          ' User is allowed to access msg (View for "msg" only)\n',
+                          ' Prevent users from seeing roles (View for "user": [\'username\', \'supervisor\', \'assignable\'] only)\n']
+
+            self.assertEqual(soutput, expected)
 
 
             self.nukeAndCreate()

Roundup Issue Tracker: http://roundup-tracker.org/