'Fetch the given course\'s info page, asserting the number of SQL
and Mongo queries.'

def fetch_course_info_with_queries(self, course, sql_queries, mongo_queries):

    url = reverse('info', args=[unicode(course.id)])
    with self.assertNumQueries(sql_queries, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
        with check_mongo_calls(mongo_queries):
            with mock.patch('openedx.core.djangoapps.theming.helpers.get_current_site', return_value=None):
                resp = self.client.get(url)
    self.assertEqual(resp.status_code, 200)
