Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paver Removal 2/3 #34830

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Install Required Python Dependencies
run: |
make base-requirements
make test-requirements

- uses: c-hive/gha-npm-cache@v1
- name: Run JS Tests
Expand Down
5 changes: 2 additions & 3 deletions cms/djangoapps/contentstore/rest_api/v0/tests/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
not the underlying Xblock service.
It checks that the assets_handler method of the Xblock service is called with the expected parameters.
"""
from unittest.mock import patch
from unittest.mock import patch, MagicMock

from django.core.files import File
from django.http import JsonResponse

from django.urls import reverse
from mock import MagicMock
from rest_framework import status
from rest_framework.test import APITestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Unit tests for Contentstore Proctored Exam Settings.
"""
from unittest.mock import patch

import ddt
from mock import patch
from django.conf import settings
from django.test.utils import override_settings
from django.urls import reverse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""
Unit tests for course settings views.
"""
from unittest.mock import patch

import ddt
from django.conf import settings
from django.urls import reverse
from mock import patch
from rest_framework import status

from cms.djangoapps.contentstore.tests.utils import CourseTestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Unit tests for course settings views.
"""
from unittest.mock import patch

import ddt
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
Expand All @@ -12,7 +14,6 @@
get_transcript_credentials_state_for_org,
get_transcript_preferences,
)
from mock import patch
from rest_framework import status

from cms.djangoapps.contentstore.video_storage_handlers import get_all_transcript_languages
Expand Down
2 changes: 1 addition & 1 deletion common/test/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
General testing utilities.
"""
from unittest.mock import Mock, patch


import functools
Expand All @@ -9,7 +10,6 @@

from django.dispatch import Signal
from markupsafe import escape
from mock import Mock, patch


@contextmanager
Expand Down
3 changes: 1 addition & 2 deletions lms/djangoapps/course_goals/tests/test_user_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from datetime import datetime, timedelta
from unittest.mock import Mock
from unittest.mock import Mock, patch

import ddt
from django.contrib.auth import get_user_model
Expand All @@ -12,7 +12,6 @@
from edx_django_utils.cache import TieredCache
from edx_toggles.toggles.testutils import override_waffle_flag
from freezegun import freeze_time
from mock import patch
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""
Tests for the Course Home Course Metadata API in the Course Home API
"""
import json
from unittest.mock import patch

import ddt
import json
import mock
from django.db import transaction
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag
from unittest.mock import patch

from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.student.models import CourseEnrollment
Expand Down Expand Up @@ -108,7 +107,7 @@ def test_streak_data_in_response(self):
CourseEnrollment.enroll(self.user, self.course.id, 'audit')
with override_waffle_flag(COURSEWARE_MFE_MILESTONES_STREAK_DISCOUNT, active=True):
UPDATES_METHOD_NAME = 'common.djangoapps.student.models.user.UserCelebration.perform_streak_updates'
with mock.patch(UPDATES_METHOD_NAME, return_value=3):
with patch(UPDATES_METHOD_NAME, return_value=3):
response = self.client.get(self.url, content_type='application/json')
celebrations = response.json()['celebrations']
assert celebrations['streak_length_to_celebrate'] == 3
Expand Down Expand Up @@ -187,7 +186,7 @@ def test_course_access(
self.update_masquerade(role=masquerade_role)

consent_url = 'dump/consent/url' if dsc_required else None
with mock.patch('openedx.features.enterprise_support.api.get_enterprise_consent_url', return_value=consent_url):
with patch('openedx.features.enterprise_support.api.get_enterprise_consent_url', return_value=consent_url):
response = self.client.get(self.url)

self._assert_course_access_response(response, expect_course_access, error_code)
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/discussion/django_comment_client/base/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import json
import logging
from contextlib import contextmanager
from unittest import mock
from unittest.mock import ANY, Mock, patch

import ddt
import mock
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test.client import RequestFactory
from django.urls import reverse
from eventtracking.processors.exceptions import EventEmissionExit
from mock import ANY, Mock, patch
from opaque_keys.edx.keys import CourseKey
from openedx_events.learning.signals import FORUM_THREAD_CREATED, FORUM_THREAD_RESPONSE_CREATED, FORUM_RESPONSE_COMMENT_CREATED

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import json
import unittest
from unittest import mock
from unittest.mock import MagicMock, patch

import pytest
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.exceptions import MultipleObjectsReturned
from django.test import TestCase
from edx_when.api import get_dates_for_course, set_dates_for_course
from edx_when.field_data import DateLookupFieldData
from mock.mock import MagicMock, patch
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from xmodule.fields import Date
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
Tests for serializers for the Mobile Course Info
"""
from unittest.mock import MagicMock, Mock, patch
from typing import Dict, List, Tuple, Union

import ddt
from django.test import TestCase
from mock import MagicMock, Mock, patch
from typing import Dict, List, Tuple, Union

from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.mobile_api.course_info.serializers import (
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/mobile_api/tests/test_course_info_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for course_info
"""
from unittest.mock import patch


import ddt
Expand All @@ -11,7 +12,6 @@
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
from rest_framework import status

from common.djangoapps.student.tests.factories import UserFactory # pylint: disable=unused-import
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/catalog/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Tests for the Catalog apps `api.py` functions.
"""
from mock import patch
from unittest.mock import patch

from django.test import TestCase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
course_overview api tests
"""
from mock import patch
from unittest.mock import patch

from django.http.response import Http404
from opaque_keys.edx.keys import CourseKey
Expand Down
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/discussions/tests/test_tasks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Tests for discussions tasks.
"""
from unittest import mock

import ddt
import mock
from edx_toggles.toggles.testutils import override_waffle_flag
from openedx_events.learning.data import DiscussionTopicContext

Expand Down
112 changes: 0 additions & 112 deletions openedx/core/djangoapps/theming/management/commands/compile_sass.py

This file was deleted.

24 changes: 0 additions & 24 deletions openedx/core/djangoapps/theming/tests/test_commands.py

This file was deleted.

2 changes: 1 addition & 1 deletion pavelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""


from . import assets, js_test, prereqs, quality
from . import js_test, quality
Loading
Loading