diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41de2be0f2..cd6264ca63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Updating package list + run: sudo apt-get update - name: Install xmlsec run: sudo apt-get install -y xmlsec1 libxmlsec1-dev - name: Install dependencies diff --git a/allauth/mfa/tests/test_views.py b/allauth/mfa/tests/test_views.py index e02858dcd9..8638b33f86 100644 --- a/allauth/mfa/tests/test_views.py +++ b/allauth/mfa/tests/test_views.py @@ -231,18 +231,12 @@ def test_cannot_deactivate_totp(auth_client, user_with_totp, user_password): assert resp.status_code == 302 resp = auth_client.get(reverse("mfa_deactivate_totp")) # When we GET, the form validation error is already on screen - assertFormError( - resp, - "form", - "__all__", - get_adapter().error_messages["cannot_delete_authenticator"], - ) + assert resp.context["form"].errors == { + "__all__": [get_adapter().error_messages["cannot_delete_authenticator"]], + } # And, when we POST anyway, it does not work resp = auth_client.post(reverse("mfa_deactivate_totp")) assert resp.status_code == 200 - assertFormError( - resp, - "form", - "__all__", - get_adapter().error_messages["cannot_delete_authenticator"], - ) + assert resp.context["form"].errors == { + "__all__": [get_adapter().error_messages["cannot_delete_authenticator"]], + }