Skip to content

Commit

Permalink
feat: enable user tours by default, dropping rollout toggle
Browse files Browse the repository at this point in the history
AA-1177
  • Loading branch information
mikix committed Feb 17, 2022
1 parent 203e2e9 commit 2038633
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
16 changes: 0 additions & 16 deletions lms/djangoapps/user_tours/toggles.py

This file was deleted.

10 changes: 0 additions & 10 deletions lms/djangoapps/user_tours/v1/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@
from django.db.models.signals import post_save
from django.test import TestCase
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag
from rest_framework import status

from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.user_tours.handlers import init_user_tour
from lms.djangoapps.user_tours.models import UserTour
from lms.djangoapps.user_tours.toggles import USER_TOURS_ENABLED
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user

User = get_user_model()


@ddt.ddt
@override_waffle_flag(USER_TOURS_ENABLED, active=True)
class TestUserTourView(TestCase):
""" Tests for the v1 User Tour views. """
def setUp(self):
Expand Down Expand Up @@ -48,13 +45,6 @@ def send_request(self, jwt_user, request_user, method, data=None):
elif method == 'PATCH':
return self.client.patch(url, data, content_type='application/json', **headers)

@ddt.data('GET', 'PATCH')
@override_waffle_flag(USER_TOURS_ENABLED, active=False)
def test_waffle_flag_off(self, method):
""" Test all endpoints if the waffle flag is turned off. """
response = self.send_request(self.staff_user, self.user, method)
assert response.status_code == status.HTTP_403_FORBIDDEN

@ddt.data('GET', 'PATCH')
def test_unauthorized_user(self, method):
""" Test all endpoints if request does not have jwt auth. """
Expand Down
7 changes: 0 additions & 7 deletions lms/djangoapps/user_tours/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from rest_framework import status

from lms.djangoapps.user_tours.models import UserTour
from lms.djangoapps.user_tours.toggles import USER_TOURS_ENABLED
from lms.djangoapps.user_tours.v1.serializers import UserTourSerializer


Expand Down Expand Up @@ -40,9 +39,6 @@ def get(self, request, username): # pylint: disable=arguments-differ
403 if waffle flag is not enabled
404 if the UserTour does not exist (shouldn't happen, but safety first)
"""
if not USER_TOURS_ENABLED.is_enabled():
return Response(status=status.HTTP_403_FORBIDDEN)

if request.user.username != username and not request.user.is_staff:
return Response(status=status.HTTP_400_BAD_REQUEST)

Expand All @@ -67,9 +63,6 @@ def patch(self, request, username): # pylint: disable=arguments-differ
401 if unauthorized request
403 if waffle flag is not enabled
"""
if not USER_TOURS_ENABLED.is_enabled():
return Response(status=status.HTTP_403_FORBIDDEN)

if request.user.username != username:
return Response(status=status.HTTP_400_BAD_REQUEST)

Expand Down

0 comments on commit 2038633

Please sign in to comment.