1
1
import re
2
-
3
2
from unittest import mock
3
+
4
4
from allauth .socialaccount .models import SocialAccount
5
5
from django .contrib .admindocs .views import extract_views_from_urlpatterns
6
6
from django .test import TestCase
9
9
from taggit .models import Tag
10
10
11
11
from readthedocs .builds .constants import BRANCH
12
- from readthedocs .builds .models import Build , BuildCommandResult
12
+ from readthedocs .builds .models import (
13
+ Build ,
14
+ BuildCommandResult ,
15
+ RegexAutomationRule ,
16
+ VersionAutomationRule ,
17
+ )
13
18
from readthedocs .core .utils .tasks import TaskNoPermission
14
19
from readthedocs .integrations .models import HttpExchange , Integration
15
20
from readthedocs .oauth .models import RemoteOrganization , RemoteRepository
16
21
from readthedocs .projects .models import Domain , EnvironmentVariable , Project
17
22
from readthedocs .rtd_tests .utils import create_user
18
- from readthedocs .builds .models import RegexAutomationRule , VersionAutomationRule
19
23
20
24
21
25
class URLAccessMixin :
@@ -479,6 +483,12 @@ def test_private_urls(self):
479
483
480
484
class PrivateUserProfileAdminAccessTest (PrivateUserProfileMixin , TestCase ):
481
485
486
+ def setUp (self ):
487
+ super ().setUp ()
488
+ self .response_data .update ({
489
+ '/accounts/login/' : {'status_code' : 302 },
490
+ })
491
+
482
492
def login (self ):
483
493
return self .client .login (username = 'owner' , password = 'test' )
484
494
@@ -488,6 +498,12 @@ def is_admin(self):
488
498
489
499
class PrivateUserProfileUserAccessTest (PrivateUserProfileMixin , TestCase ):
490
500
501
+ def setUp (self ):
502
+ super ().setUp ()
503
+ self .response_data .update ({
504
+ '/accounts/login/' : {'status_code' : 302 },
505
+ })
506
+
491
507
def login (self ):
492
508
return self .client .login (username = 'tester' , password = 'test' )
493
509
@@ -506,6 +522,7 @@ def setUp(self):
506
522
self .response_data .update ({
507
523
'/accounts/tokens/create/' : {'status_code' : 302 },
508
524
'/accounts/tokens/delete/' : {'status_code' : 302 },
525
+ '/accounts/login/' : {'status_code' : 200 },
509
526
})
510
527
511
528
def login (self ):
0 commit comments