Skip to content

Commit 83b2442

Browse files
committed
Fix tests
1 parent 0859d6a commit 83b2442

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

readthedocs/rtd_tests/tests/test_privacy_urls.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
2-
32
from unittest import mock
3+
44
from allauth.socialaccount.models import SocialAccount
55
from django.contrib.admindocs.views import extract_views_from_urlpatterns
66
from django.test import TestCase
@@ -9,13 +9,17 @@
99
from taggit.models import Tag
1010

1111
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+
)
1318
from readthedocs.core.utils.tasks import TaskNoPermission
1419
from readthedocs.integrations.models import HttpExchange, Integration
1520
from readthedocs.oauth.models import RemoteOrganization, RemoteRepository
1621
from readthedocs.projects.models import Domain, EnvironmentVariable, Project
1722
from readthedocs.rtd_tests.utils import create_user
18-
from readthedocs.builds.models import RegexAutomationRule, VersionAutomationRule
1923

2024

2125
class URLAccessMixin:
@@ -479,6 +483,12 @@ def test_private_urls(self):
479483

480484
class PrivateUserProfileAdminAccessTest(PrivateUserProfileMixin, TestCase):
481485

486+
def setUp(self):
487+
super().setUp()
488+
self.response_data.update({
489+
'/accounts/login/': {'status_code': 302},
490+
})
491+
482492
def login(self):
483493
return self.client.login(username='owner', password='test')
484494

@@ -488,6 +498,12 @@ def is_admin(self):
488498

489499
class PrivateUserProfileUserAccessTest(PrivateUserProfileMixin, TestCase):
490500

501+
def setUp(self):
502+
super().setUp()
503+
self.response_data.update({
504+
'/accounts/login/': {'status_code': 302},
505+
})
506+
491507
def login(self):
492508
return self.client.login(username='tester', password='test')
493509

@@ -506,6 +522,7 @@ def setUp(self):
506522
self.response_data.update({
507523
'/accounts/tokens/create/': {'status_code': 302},
508524
'/accounts/tokens/delete/': {'status_code': 302},
525+
'/accounts/login/': {'status_code': 200},
509526
})
510527

511528
def login(self):

0 commit comments

Comments
 (0)