starter_packs/tests.py::TestEditStarterPack::test_edit_starter_pack_post

First seen 1 month ago in commit 1b5db pushed by Anže Pečar

Last 98 Runs
Pass % 99.0%
p50 duration 0.1487s
p95 duration 0.1622s

95 runs 94 passed 1 failed in the last 30 days

Run 1 week, 2 days ago
Status FAIL
Commit

#91 Start adding translation strings

Commit 00de4 pushed by Anže Pečar
Repr
self = <starter_packs.tests.TestEditStarterPack testMethod=test_edit_starter_pack_post>

    def test_edit_starter_pack_post(self):
        self.client.force_login(self.user)
        response = self.client.post(
            reverse("edit_starter_pack", args=[self.starter_pack.slug]),
            {
                "title": "New title",
                "description": "New description",
            },
        )
        self.starter_pack.refresh_from_db()
        self.assertEqual(self.starter_pack.title, "New title")
        self.assertEqual(self.starter_pack.description, "New description")
>       self.assertRedirects(response, reverse("edit_accounts_starter_pack", args=[self.starter_pack.slug]))

starter_packs/tests.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.13/site-packages/django/test/testcases.py:507: in assertRedirects
    redirect_response = response.client.get(
.venv/lib/python3.13/site-packages/django/test/client.py:1129: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:479: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:676: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1092: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:805: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/contrib/auth/decorators.py:60: in _view_wrapper
    return view_func(request, *args, **kwargs)
starter_packs/views.py:156: in add_accounts_to_starter_pack
    return render(
.venv/lib/python3.13/site-packages/django/shortcuts.py:25: in render
    content = loader.render_to_string(template_name, context, request, using=using)
.venv/lib/python3.13/site-packages/django/template/loader.py:62: in render_to_string
    return template.render(context, request)
.venv/lib/python3.13/site-packages/django/template/backends/django.py:107: in render
    return self.template.render(context)
.venv/lib/python3.13/site-packages/django/template/base.py:171: in render
    return self._render(context)
.venv/lib/python3.13/site-packages/django/test/utils.py:114: in instrumented_test_render
    return self.nodelist.render(context)
.venv/lib/python3.13/site-packages/django/template/base.py:1008: in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
.venv/lib/python3.13/site-packages/django/template/base.py:969: in render_annotated
    return self.render(context)
.venv/lib/python3.13/site-packages/django/template/loader_tags.py:159: in render
    return compiled_parent._render(context)
.venv/lib/python3.13/site-packages/django/test/utils.py:114: in instrumented_test_render
    return self.nodelist.render(context)
.venv/lib/python3.13/site-packages/django/template/base.py:1008: in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
.venv/lib/python3.13/site-packages/django/template/base.py:969: in render_annotated
    return self.render(context)
.venv/lib/python3.13/site-packages/django/template/loader_tags.py:65: in render
    result = block.nodelist.render(context)
.venv/lib/python3.13/site-packages/django/template/base.py:1008: in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
.venv/lib/python3.13/site-packages/django/template/base.py:969: in render_annotated
    return self.render(context)
.venv/lib/python3.13/site-packages/django/template/loader_tags.py:199: in render
    template = context.template.engine.select_template(template_name)
.venv/lib/python3.13/site-packages/django/template/engine.py:208: in select_template
    return self.get_template(template_name)
.venv/lib/python3.13/site-packages/django/template/engine.py:177: in get_template
    template, origin = self.find_template(template_name)
.venv/lib/python3.13/site-packages/django/template/engine.py:159: in find_template
    template = loader.get_template(name, skip=skip)
.venv/lib/python3.13/site-packages/template_partials/loader.py:41: in get_template
    template = self.loaders[0].get_template(template_name, skip)
.venv/lib/python3.13/site-packages/django/template/loaders/cached.py:57: in get_template
    template = super().get_template(template_name, skip)
.venv/lib/python3.13/site-packages/django/template/loaders/base.py:28: in get_template
    return Template(
.venv/lib/python3.13/site-packages/django/template/base.py:154: in __init__
    self.nodelist = self.compile_nodelist()
.venv/lib/python3.13/site-packages/django/template/base.py:196: in compile_nodelist
    nodelist = parser.parse()
.venv/lib/python3.13/site-packages/django/template/base.py:518: in parse
    raise self.error(token, e)
.venv/lib/python3.13/site-packages/django/template/base.py:516: in parse
    compiled_result = compile_func(self, token)
.venv/lib/python3.13/site-packages/django/template/defaulttags.py:862: in do_for
    nodelist_loop = parser.parse(
.venv/lib/python3.13/site-packages/django/template/base.py:518: in parse
    raise self.error(token, e)
.venv/lib/python3.13/site-packages/django/template/base.py:516: in parse
    compiled_result = compile_func(self, token)
.venv/lib/python3.13/site-packages/django/template/defaulttags.py:962: in do_if
    nodelist = parser.parse(("elif", "else", "endif"))
.venv/lib/python3.13/site-packages/django/template/base.py:518: in parse
    raise self.error(token, e)
.venv/lib/python3.13/site-packages/django/template/base.py:516: in parse
    compiled_result = compile_func(self, token)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

parser = <Parser tokens=[<Text token: "</ul>...">, <Block token: "endif...">, <Text token: "    ...">, <Block token: "endif..."......">, <Text token: "                   ...">, <Block token: "blocktrans...">, <Text token: "                   ...">]>
token = <Block token: "with url = "https://...">

    @register.tag("with")
    def do_with(parser, token):
        """
        Add one or more values to the context (inside of this block) for caching
        and easy access.
    
        For example::
    
            {% with total=person.some_sql_method %}
                {{ total }} object{{ total|pluralize }}
            {% endwith %}
    
        Multiple values can be added to the context::
    
            {% with foo=1 bar=2 %}
                ...
            {% endwith %}
    
        The legacy format of ``{% with person.some_sql_method as total %}`` is
        still accepted.
        """
        bits = token.split_contents()
        remaining_bits = bits[1:]
        extra_context = token_kwargs(remaining_bits, parser, support_legacy=True)
        if not extra_context:
>           raise TemplateSyntaxError(
                "%r expected at least one variable assignment" % bits[0]
            )
E           django.template.exceptions.TemplateSyntaxError: 'with' expected at least one variable assignment

.venv/lib/python3.13/site-packages/django/template/defaulttags.py:1533: TemplateSyntaxError