def METHOD_NAME(self, filename, context, rendered_filename=None):
    template = self._get_file('templates', '{}.html'.format(filename))
    actual = self._render_template(template, context)
    # Expected template shouldn't include the tag being rendered but may require other template tags
    rendered_filename = rendered_filename or filename
    expected_template = self._get_file('rendered', '{}.html'.format(rendered_filename))
    expected = self._render_template(expected_template)
    # Removed when Django 2.x is no longer supported
    import django
    if django.VERSION[0] < 3:
        expected = expected.replace("&#x27;", "&#39;")
    self.assertEqual(
        self._normalize_whitespace(actual),
        self._normalize_whitespace(expected),
    )