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

Fix tests #174

Merged
merged 8 commits into from
Mar 30, 2022
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/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10']
django-version: ['3.2', '4.0']

steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/)
[![PyPI Download](https://img.shields.io/pypi/v/django-invitations.svg)](https://pypi.python.org/pypi/django-invitations)
[![PyPI Python Versions](https://img.shields.io/pypi/pyversions/django-invitations.svg)](https://pypi.python.org/pypi/django-invitations)
[![Build Status](https://travis-ci.org/bee-keeper/django-invitations.svg?branch=master)](https://travis-ci.org/bee-keeper/django-invitations)
[![Build status](https://github.com/jazzband/django-invitations/actions/workflows/test.yml/badge.svg)](https://github.com/jazzband/django-invitations/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/bee-keeper/django-invitations/badge.svg?branch=master&service=github)](https://coveralls.io/github/bee-keeper/django-invitations?branch=master)

## About
Expand Down
1 change: 0 additions & 1 deletion invitations/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
default_app_config = 'invitations.apps.Config'
17 changes: 8 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Django>=1.1.*
coverage==4.5.4
flake8==3.7.9
freezegun==0.3.12
mock==3.0.5
pytest==5.2.2
pytest-django==3.6.0
pytest-cov==2.8.1
tox==3.14.0
Django>=3.2.*
coverage==6.3.2
flake8==4.0.1
freezegun==1.2.
pytest==7.1.1
pytest-django==4.5.2
pytest-cov==3.0.0
tox==3.24.5
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
description='Generic invitations app with support for django-allauth',
author='https://github.com/bee-keeper',
author_email='[email protected]',
url='https://github.com/bee-keeper/django-invitations.git',
download_url='https://github.com/'
'bee-keeper/django-invitations/tarball/1.9.3',
url='https://github.com/jazzband/django-invitations.git',
keywords=['django', 'invitation', 'django-allauth', 'invite'],
license='GPL-3.0-only',
classifiers=[
Expand All @@ -21,11 +19,13 @@
'Topic :: Software Development :: Libraries :: Python Modules',
'Environment :: Web Environment',
'Topic :: Internet',
'Framework:: Django:: 3.2',
'Framework:: Django:: 4.0',
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: GPL-3.0-only',
'Framework :: Django',
],
Expand Down
8 changes: 4 additions & 4 deletions test_urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from django.conf.urls import url, include
from django.urls import path, include
from django.contrib import admin
from django.conf import settings

admin.autodiscover()

urlpatterns = [
url(r'^invitations/', include('invitations.urls')),
url(r'^admin/', admin.site.urls),
path('invitations/', include('invitations.urls')),
path('admin/', admin.site.urls),
]

if 'allauth' in settings.INSTALLED_APPS:
urlpatterns.append(
url(r'^accounts/', include('allauth.urls'))
path('accounts/', include('allauth.urls'))
)
6 changes: 3 additions & 3 deletions tests/basic/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import re
import json
from mock import patch
from unittest.mock import patch

from django.test import Client
from django.test.client import RequestFactory
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_valid_form_submission(self, user_a):
assert mail.outbox[0].to[0] == '[email protected]'
assert 'Invitation to join example.com' in mail.outbox[0].subject
url = re.search(
"(?P<url>/invitations/[^\s]+)", mail.outbox[0].body).group("url")
r"(?P<url>/invitations/[^\s]+)", mail.outbox[0].body).group("url")
assert url == reverse(
'invitations:accept-invite', kwargs={'key': invitation.key})

Expand All @@ -131,7 +131,7 @@ def test_valid_form_submission_with_swapped_model(self, user_a):
assert mail.outbox[0].to[0] == '[email protected]'
assert 'Invitation to join example.com' in mail.outbox[0].subject
url = re.search(
"(?P<url>/invitations/[^\s]+)", mail.outbox[0].body).group("url")
r"(?P<url>/invitations/[^\s]+)", mail.outbox[0].body).group("url")
assert url == reverse(
'invitations:accept-invite', kwargs={'key': invitation.key})

Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38, flake8
3.9: py39
Expand All @@ -13,7 +12,7 @@ DJANGO =

[tox]
envlist =
py{36,37,38,39,310}-django{32}-backend{Basic,Allauth}
py{37,38,39,310}-django{32}-backend{Basic,Allauth}
py{38,39,310}-django{40}-backend{Basic,Allauth}
flake8

Expand Down