Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deps] Allauth update, openwisp-utils ~= 1.1.0 #548

Merged
merged 5 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
coverage run runtests.py --parallel
coverage run runtests.py --parallel || ./runtests.py
# SAMPLE tests do not influence coverage, so we can speed up tests with --parallel
SAMPLE_APP=1 coverage run ./runtests.py --parallel > /dev/null 2>&1 || SAMPLE_APP=1 ./runtests.py
coverage combine
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/templates/djangosaml2/auth_error.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base_entrance.html" %}
{% load i18n %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/templates/djangosaml2/login_error.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base_entrance.html" %}
{% load i18n %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/templates/djangosaml2/logout_error.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base_entrance.html" %}
{% load i18n %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/templates/djangosaml2/wayf.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "account/base.html" %}
{% extends "account/base_manage.html" %}
{% load i18n %}

{% block content %}
Expand Down
7 changes: 7 additions & 0 deletions openwisp_radius/tests/test_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import swapper
from allauth.account.forms import default_token_generator
from allauth.account.models import EmailAddress
from allauth.account.utils import user_pk_to_url_str
from dj_rest_auth.tests.utils import (
override_api_settings as override_dj_rest_auth_settings,
Expand Down Expand Up @@ -167,13 +168,19 @@ def test_register_400_password(self):

def test_register_400_duplicate_user(self):
self.test_register_201()
# The duplicate email validation error only triggers
# when the same email has been verified by another user.
EmailAddress.objects.update(verified=True)
r = self._register_user(expect_201=False, expect_users=None)
self.assertEqual(r.status_code, 400)
self.assertIn('username', r.data)
self.assertIn('email', r.data)

def test_register_duplicate_same_org(self):
self.test_register_201()
# The duplicate email validation error only triggers
# when the same email has been verified by another user.
EmailAddress.objects.update(verified=True)
response = self._register_user(expect_201=False, expect_users=None)
self.assertIn('username', response.data)
self.assertIn('email', response.data)
Expand Down
4 changes: 4 additions & 0 deletions openwisp_radius/tests/test_api/test_phone_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from unittest import mock

import swapper
from allauth.account.models import EmailAddress
from dateutil import parser
from django.contrib.auth import get_user_model
from django.core.cache import cache
Expand Down Expand Up @@ -114,6 +115,9 @@ def test_register_400_duplicate_phone_number(self):

def test_register_400_duplicate_user(self):
self.test_register_201_mobile_phone_verification()
# The duplicate email validation error only triggers
# when the same email has been verified by another user.
EmailAddress.objects.update(verified=True)
r = self._register_user(expect_201=False, expect_users=None)
self.assertEqual(r.status_code, 400)
self.assertIn('username', r.data)
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ packaging
openwisp-sphinx-theme~=1.0.2
freezegun
django-extensions
openwisp-utils[qa] @ https://github.com/openwisp/openwisp-utils/tarball/master
openwisp-utils[qa]~=1.1.0
pylinkvalidator
lxml~=5.2.2
cssselect~=1.2.0
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@
'openwisp-users '
'@ https://github.com/openwisp/openwisp-users/tarball/master'
),
(
'openwisp-utils[rest,celery] @ '
'https://github.com/openwisp/openwisp-utils/tarball/master'
),
'openwisp-utils[rest,celery]~=1.1.0',
'passlib~=1.7.1',
'djangorestframework-link-header-pagination~=0.1.1',
'weasyprint~=59.0',
'pydyf~=0.10.0', # remove this once we upgrade wasyprint
'dj-rest-auth~=4.0.1',
'dj-rest-auth~=6.0.0',
'django-sendsms~=0.5.0',
'jsonfield~=3.1.0',
'django-private-storage~=3.1.0',
Expand Down
1 change: 1 addition & 0 deletions tests/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'allauth.account.middleware.AccountMiddleware',
'sesame.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
Expand Down