def _create_template(self, template_dir, test_string, extends):
        """
        Creates the test template in the given template directory, with
        the test string injected that we'll use for the real test.
        """
        with open(os.path.join(template_dir, self.unique_id), "w") as f:
            template_vars = {
                "test_string": test_string,
                "extends_string": "",
                "super_string": "",
            }
            if extends:
                extends_string = "{%% overextends \"%s\" %%}" % self.unique_id
                template_vars["extends_string"] = extends_string
                template_vars["super_string"] = "{{ block.super }}"
            f.write((TEST_TEMPLATE % template_vars).strip())
dataset/ETHPy150Open stephenmcd/django-overextends/overextends/tests.py/Tests._create_template/original