#4826 Fix sorting users by their username in python3 and introduce a new requirement on email_validator
Merged 3 years ago by pingou. Opened 3 years ago by pingou.

file modified
+6 -3
@@ -969,13 +969,16 @@ 

          """

          return {

              "admin": sorted(

-                 self.get_project_users(access="admin", combine=False)

+                 self.get_project_users(access="admin", combine=False),

+                 key=lambda u: u.user,

              ),

              "commit": sorted(

-                 self.get_project_users(access="commit", combine=False)

+                 self.get_project_users(access="commit", combine=False),

+                 key=lambda u: u.user,

              ),

              "ticket": sorted(

-                 self.get_project_users(access="ticket", combine=False)

+                 self.get_project_users(access="ticket", combine=False),

+                 key=lambda u: u.user,

              ),

          }

  

file modified
+1
@@ -11,6 +11,7 @@ 

  cryptography

  docutils

  enum34;python_version<"3.4"

+ email_validator

  flask

  flask-wtf

  kitchen

@@ -2859,6 +2859,8 @@ 

              "error_code": "EINVALIDREQ",

              "errors": {"status": ["Not a valid choice"]},

          }

+         if self.get_wtforms_version() >= (2, 3):

+             expected_output["errors"]["status"] = ["This field is required."]

          self.assertEqual(data, expected_output)

  

      def test_flag_commit_missing_username(self):
@@ -3421,6 +3423,10 @@ 

                  "user_type": ["Not a valid choice"],

              },

          }

+         if self.get_wtforms_version() >= (2, 3):

+             expected_output["errors"]["user_type"] = [

+                 "This field is required."

+             ]

          self.assertEqual(data, expected_output)

  

      def test_api_modify_acls_invalid_acl(self):

no initial comment

2 new commits added

  • Fix sorting users by their username when using python3
  • The latest version of wtforms requires email_validator for our use of it
3 years ago

2 new commits added

  • Fix sorting users by their username when using python3
  • The latest version of wtforms requires email_validator for our use of it
3 years ago

rebased onto 5ce6dd00aa57955ad1d2f9ff6a3b58727508bf31

3 years ago

pip container:

======================================================================
FAIL: test_flag_commit_missing_status (tests.test_pagure_flask_api_project.PagureFlaskApiProjectFlagtests): Test flagging a commit with missing precentage.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/pagure/tests/test_pagure_flask_api_project.py", line 2864, in test_flag_commit_missing_status
    self.assertEqual(data, expected_output)
AssertionError: {'err[62 chars]INVALIDREQ', 'errors': {'status': ['This field is required.']}} != {'err[62 chars]INVALIDREQ', 'errors': {'status': ['This field is required']}}
  {'error': 'Invalid or incomplete input submitted',
   'error_code': 'EINVALIDREQ',
-  'errors': {'status': ['This field is required.']}}
?                                               -

+  'errors': {'status': ['This field is required']}}
-------------------- >> begin captured logging << --------------------
pagure.utils: INFO: logging already setup
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_api_modify_acls_neither_user_nor_group (tests.test_pagure_flask_api_project.PagureFlaskApiProjectModifyAclTests): Test the api_modify_acls method of the flask api when neither
        user nor group was set
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/pagure/tests/test_pagure_flask_api_project.py", line 3428, in test_api_modify_acls_neither_user_nor_group
    self.assertEqual(data, expected_output)
AssertionError: {'err[102 chars]his field is required.'], 'name': ['This field is required.']}} != {'err[102 chars]his field is required'], 'name': ['This field is required.']}}
  {'error': 'Invalid or incomplete input submitted',
   'error_code': 'EINVALIDREQ',
   'errors': {'name': ['This field is required.'],
-             'user_type': ['This field is required.']}}
?                                                  -

+             'user_type': ['This field is required']}}
-------------------- >> begin captured logging << --------------------
pagure.utils: INFO: logging already setup
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------

rebased onto 59e0717efe1cec63f4389123058e5e13469ab753

3 years ago

Only a style test failure:

07:54:33  Failed tests:
07:54:33  FAILED test: py3-test_style

rebased onto f1444a4

3 years ago

Pull-Request has been merged by pingou

3 years ago