jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[tests] Ensure that login is made prior than rights are checked

Bug: T331266
Change-Id: I19bdf4a7db13996a93cfbd8fbe5ad817931ab97c
---
M tests/aspects.py
1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tests/aspects.py b/tests/aspects.py
index 5ab221c..b011986 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -601,8 +601,7 @@

@classmethod
def setUpClass(cls):
- """
- Set up the test class.
+ """Set up the test class.

Skip the test class if the user config does not have
a valid login to the site.
@@ -853,12 +852,16 @@
bases = cls.add_base(bases, SiteWriteMixin)

if dct.get('rights'):
- bases = cls.add_base(bases, NeedRightsMixin)
dct.setdefault('login', True)

if dct.get('login'):
bases = cls.add_base(bases, RequireLoginMixin)

+ # Add NeedRightsMixin after RequireLoginMixin to ensure
+ # login is made prior to rights check
+ if dct.get('rights'):
+ bases = cls.add_base(bases, NeedRightsMixin)
+
for test in tests:
test_func = dct[test]


To view, visit change 894530. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I19bdf4a7db13996a93cfbd8fbe5ad817931ab97c
Gerrit-Change-Number: 894530
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: BinĂ¡ris <wikiposta@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged