'Ensure that the template tags use cached content types to reduce the
number of DB queries.
Refs #16042.'

def testNumberQueries(self):

    self.createSomeComments()
    ContentType.objects.clear_cache()
    with self.assertNumQueries(4):
        self.testRenderCommentListFromObject()
    with self.assertNumQueries(3):
        self.testRenderCommentListFromObject()
    ContentType.objects.clear_cache()
    with self.assertNumQueries(4):
        self.verifyGetCommentList()
    with self.assertNumQueries(3):
        self.verifyGetCommentList()
    ContentType.objects.clear_cache()
    with self.assertNumQueries(3):
        self.testRenderCommentForm()
    with self.assertNumQueries(2):
        self.testRenderCommentForm()
    ContentType.objects.clear_cache()
    with self.assertNumQueries(3):
        self.testGetCommentForm()
    with self.assertNumQueries(2):
        self.testGetCommentForm()
    ContentType.objects.clear_cache()
    with self.assertNumQueries(3):
        self.verifyGetCommentCount()
    with self.assertNumQueries(2):
        self.verifyGetCommentCount()
