Skip to content

Commit f6fcfee

Browse files
renzorenzon
authored andcommitted
Removed root redirect
close #4862
1 parent faf45fc commit f6fcfee

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

‎pythonpro/core/tests/test_view_home.py‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import pytest
2-
from django.test import Client
32
from django.urls import reverse
4-
from model_bakery import baker
53

64

75
@pytest.fixture
@@ -14,31 +12,16 @@ def _resp(client):
1412
return client.get('/')
1513

1614

17-
@pytest.fixture
18-
def home_resp_with_user(django_user_model, client: Client, settings):
19-
settings.DISCOURSE_BASE_URL = 'https://forum.python.pro.br/'
20-
user = baker.make(django_user_model)
21-
client.force_login(user)
22-
return _resp(client)
23-
24-
2515
def test_home_status_code(home_resp):
26-
assert 302 == home_resp.status_code
16+
assert home_resp.status_code == 302
17+
assert home_resp.url == reverse('dashboard:home')
2718

2819

2920
def test_thanks_status_code(client):
3021
resp = client.get(reverse('core:thanks'))
3122
assert 200 == resp.status_code
3223

3324

34-
def test_redirec_to_dashboard(home_resp_with_user):
35-
"""
36-
Assert User is redirected to dashboard
37-
"""
38-
assert home_resp_with_user.status_code == 302
39-
assert home_resp_with_user.url == reverse('dashboard:home')
40-
41-
4225
@pytest.fixture
4326
def home_resp_open_subscriptions(client, mocker):
4427
mocker.patch('pythonpro.core.views.is_launch_open', return_value=True)

‎pythonpro/core/views.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525

2626
def index(request):
27-
if request.user.is_authenticated:
28-
return redirect(reverse('dashboard:home'))
29-
return redirect('https://pythonpro.com.br')
27+
return redirect(reverse('dashboard:home'))
3028

3129

3230
def thanks(request):

0 commit comments

Comments
 (0)