comaptibility with python 3.11 (#86369)
gitea/django-journal/pipeline/head This commit looks good
Details
gitea/django-journal/pipeline/head This commit looks good
Details
This commit is contained in:
parent
cfeae7afbe
commit
c38f63e80b
|
@ -6,17 +6,17 @@ repos:
|
|||
hooks:
|
||||
- id: double-quote-string-fixer
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 20.8b1
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
|
||||
args: ['--target-version', 'py39', '--skip-string-normalization', '--line-length', '110']
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ['--profile', 'black', '--line-length', '110']
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.1.0
|
||||
rev: v3.3.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ['--keep-percent-format', '--py37-plus']
|
||||
args: ['--keep-percent-format', '--py39-plus']
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0002_remove_content_type_name'),
|
||||
]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import pytest
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.db import transaction
|
||||
from django.test import TestCase
|
||||
|
@ -72,7 +73,8 @@ class JournalTestCase(TestCase):
|
|||
self.assertEqual(l[1]['user'], '<deleted>')
|
||||
|
||||
|
||||
def test_error_record(db):
|
||||
@pytest.mark.django_db(databases=['default', 'error'])
|
||||
def test_error_record(transactional_db):
|
||||
error_record('error', 'error message')
|
||||
journal = Journal.objects.first()
|
||||
assert journal.tag.name == 'error'
|
||||
|
@ -83,7 +85,8 @@ def test_error_record(db):
|
|||
assert Journal.objects.count() == 2
|
||||
|
||||
|
||||
def test_error_record_with_db_obj(db):
|
||||
@pytest.mark.django_db(databases=['default', 'error'])
|
||||
def test_error_record_with_db_obj(transactional_db):
|
||||
tag = Tag.objects.create(name='some-tag')
|
||||
journal = error_record('error', 'error message', someobj=tag)
|
||||
objdata = journal.objectdata_set.first()
|
||||
|
|
5
tox.ini
5
tox.ini
|
@ -8,11 +8,12 @@ usedevelop = True
|
|||
deps =
|
||||
django22: django>=2.2,<2.3
|
||||
django32: django>=3.2.12,<3.3
|
||||
psycopg2<2.9
|
||||
psycopg2-binary
|
||||
pytest-cov
|
||||
pytest
|
||||
pytest-django<4.3
|
||||
pytest-django
|
||||
setenv =
|
||||
PYTHONPATH=.
|
||||
DJANGO_SETTINGS_MODULE=test_settings
|
||||
coverage: COVERAGE=--cov-append --cov-report xml --cov-report html --cov=django_journal/
|
||||
commands =
|
||||
|
|
Loading…
Reference in New Issue