Skip to content

Commit

Permalink
chore: fixup rebase misses
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinkoff committed Nov 16, 2023
1 parent 1fac6ec commit 7b4a7dc
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
5 changes: 2 additions & 3 deletions lms/djangoapps/courseware/tests/test_discussion_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,8 @@ def test_permissions_query_load(self):
# * lms_xblock_xblockasidesconfig
# * django_comment_client_role
# * DiscussionsConfiguration
# * CourseRolesUserRole (*4)

num_queries = 9
num_queries = 6

for discussion in discussions:
discussion_xblock = get_block_for_descriptor(
Expand All @@ -467,7 +466,7 @@ def test_permissions_query_load(self):

# query to check for provider_type
# query to check waffle flag discussions.enable_new_structure_discussions
num_queries = 5
num_queries = 2

html = fragment.content
assert 'data-user-create-comment="false"' in html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def inner(self, default_store, block_count, mongo_calls, sql_queries, *args, **k
return inner

@ddt.data(
(ModuleStoreEnum.Type.split, 3, 8, 42),
(ModuleStoreEnum.Type.split, 3, 8, 43),
)
@ddt.unpack
@count_queries
Expand Down
8 changes: 4 additions & 4 deletions lms/djangoapps/discussion/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,13 @@ class SingleThreadQueryCountTestCase(ForumsEnableMixin, ModuleStoreTestCase):
"""
@ddt.data(
# split mongo: 3 queries, regardless of thread response size.
(False, 1, 2, 2, 21, 7),
(False, 50, 2, 2, 21, 7),
(False, 1, 2, 2, 21, 8),
(False, 50, 2, 2, 21, 8),
# Enabling Enterprise integration should have no effect on the number of mongo queries made.
# split mongo: 3 queries, regardless of thread response size.
(True, 1, 2, 2, 21, 7),
(True, 50, 2, 2, 21, 7),
(True, 1, 2, 2, 21, 8),
(True, 50, 2, 2, 21, 8),
)
@ddt.unpack
def test_number_of_mongo_queries(
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/teams/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def assert_serializer_output(self, topics, num_teams_per_topic, num_queries):
request = RequestFactory().get('/api/team/v0/topics')
request.user = self.user

with self.assertNumQueries(num_queries + 1): # num_queries on teams tables, plus 2 split modulestore queries
with self.assertNumQueries(num_queries + 2): # num_queries on teams tables, plus 2 split modulestore queries
serializer = self.serializer(
topics,
context={
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/course_roles/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from enum import Enum, unique

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


@unique
Expand Down
Empty file.
1 change: 1 addition & 0 deletions openedx/core/djangoapps/course_roles/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class PermissionCheckTestCase(SharedModuleStoreTestCase):
"""
def setUp(self):
super().setUp()
self.anonymous_user = AnonymousUserFactory()
self.user_1 = UserFactory(username="test_user_1")
self.organization_1 = OrganizationFactory(name="test_organization_1")
self.organization_2 = OrganizationFactory(name="test_organization_2")
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/embargo/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_caching(self):
with self.assertNumQueries(3):
embargo_api.check_course_access(self.course.id, user=self.user, ip_addresses=['0.0.0.0'])

with self.assertNumQueries(3):
with self.assertNumQueries(0):
embargo_api.check_course_access(self.course.id, user=self.user, ip_addresses=['0.0.0.0'])

def test_caching_no_restricted_courses(self):
Expand Down

0 comments on commit 7b4a7dc

Please sign in to comment.