0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

WagtailTestUtils.get_soup should accept HttpResponse, not HttpRequest

This commit is contained in:
Matt Westcott 2023-08-17 14:32:07 +01:00 committed by Matt Westcott
parent cf9c264875
commit 9dcebc549a

View File

@ -4,14 +4,14 @@ from contextlib import contextmanager
from bs4 import BeautifulSoup
from django import VERSION as DJANGO_VERSION
from django.contrib.auth import get_user_model
from django.http import HttpRequest
from django.http import HttpResponse
from django.test.testcases import assert_and_parse_html
class WagtailTestUtils:
@staticmethod
def get_soup(request: HttpRequest, parser="html.parser") -> BeautifulSoup:
return BeautifulSoup(request.content, parser)
def get_soup(response: HttpResponse, parser="html.parser") -> BeautifulSoup:
return BeautifulSoup(response.content, parser)
@staticmethod
def create_test_user():