@@ -103,7 +103,7 @@ def test_get(self):
103
103
""" Verify the endpoint returns the details for a single course. """
104
104
url = reverse ('api:v1:course-detail' , kwargs = {'key' : self .course .key })
105
105
106
- with self .assertNumQueries (43 , threshold = 3 ):
106
+ with self .assertNumQueries (26 , threshold = 3 ):
107
107
response = self .client .get (url )
108
108
assert response .status_code == 200
109
109
assert response .data == self .serialize_course (self .course )
@@ -112,7 +112,7 @@ def test_get_uuid(self):
112
112
""" Verify the endpoint returns the details for a single course with UUID. """
113
113
url = reverse ('api:v1:course-detail' , kwargs = {'key' : self .course .uuid })
114
114
115
- with self .assertNumQueries (44 ):
115
+ with self .assertNumQueries (27 ):
116
116
response = self .client .get (url )
117
117
assert response .status_code == 200
118
118
assert response .data == self .serialize_course (self .course )
@@ -121,7 +121,7 @@ def test_get_exclude_deleted_programs(self):
121
121
""" Verify the endpoint returns no deleted associated programs """
122
122
ProgramFactory (courses = [self .course ], status = ProgramStatus .Deleted )
123
123
url = reverse ('api:v1:course-detail' , kwargs = {'key' : self .course .key })
124
- with self .assertNumQueries (43 ):
124
+ with self .assertNumQueries (26 ):
125
125
response = self .client .get (url )
126
126
assert response .status_code == 200
127
127
assert response .data .get ('programs' ) == []
@@ -134,7 +134,7 @@ def test_get_include_deleted_programs(self):
134
134
ProgramFactory (courses = [self .course ], status = ProgramStatus .Deleted )
135
135
url = reverse ('api:v1:course-detail' , kwargs = {'key' : self .course .key })
136
136
url += '?include_deleted_programs=1'
137
- with self .assertNumQueries (47 ):
137
+ with self .assertNumQueries (29 ):
138
138
response = self .client .get (url )
139
139
assert response .status_code == 200
140
140
assert response .data == self .serialize_course (self .course , extra_context = {'include_deleted_programs' : True })
0 commit comments