diff --git a/projboard/tests/test_client.py b/projboard/tests/test_client.py index 960a14d..8b2aea6 100644 --- a/projboard/tests/test_client.py +++ b/projboard/tests/test_client.py @@ -172,12 +172,7 @@ def test_fill_article_post(client, article, django_capture_on_commit_callbacks): 'user_id': 1, 'content': article.content }) - - # Page after the post - template_names = set(tmpl.origin.template_name for tmpl in response.templates) - # TODO change board.html to my_article.html - assert 'landing/homepage.html' in template_names - assert response.status_code == 200 + assert response.status_code == 302 @pytest.mark.django_db diff --git a/projboard/views.py b/projboard/views.py index 4561c3f..0d66f5d 100644 --- a/projboard/views.py +++ b/projboard/views.py @@ -61,8 +61,7 @@ def create_article(request): form = CreateArticleForm(request.POST, initial={'user_id': user}) if form.is_valid(): form.save() - # TODO when we end to create the "my articles" page, change the redirect - return render(request, 'landing/homepage.html', {'articles': Article.search_by_user(user)}) + return redirect(f'/my_articles/{user.nickname}') elif request.method == "DELETE": raise Http404() else: