def _create_template(self, template_dir, test_string, extends):
        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())
Takes a document and returns a bytestring.
dataset/ETHPy150Open stephenmcd/django-overextends/overextends/tests.py/Tests._create_template--crossover with--dataset/ETHPy150Open core-api/python-client/coreapi/codecs/corejson.py/CoreJSONCodec.dump