Skip to content

Commit

Permalink
Bump to Django 4 (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller authored Apr 1, 2023
1 parent 41c736f commit 16098af
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .idea/codestream.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ repos:
hooks:
- id: pyupgrade
args: ["--py310-plus"]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.13.0 # replace with latest tag on GitHub
hooks:
- id: django-upgrade
args: [--target-version, "4.1"] # Replace with Django version
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
2 changes: 0 additions & 2 deletions openach/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""Analysis of Competing Hypotheses Django application module."""

default_app_config = "openach.apps.OpenACHConfig"
2 changes: 1 addition & 1 deletion openach/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class EvidenceInline(admin.StackedInline):
extra = 2


@admin.register(Board)
class BoardAdmin(admin.ModelAdmin):
"""Admin interface for editing ACH boards."""

inlines = [HypothesisInline, EvidenceInline]


admin.site.register(Board, BoardAdmin)
admin.site.register(EvidenceSourceTag)
admin.site.register(ProjectNews)
admin.site.register(Team)
8 changes: 3 additions & 5 deletions openach/migrations/0005_evidencesource_source_date.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-26 16:56
from __future__ import unicode_literals

import datetime

from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):

dependencies = [
("openach", "0004_auto_20160826_1651"),
]
Expand All @@ -19,7 +15,9 @@ class Migration(migrations.Migration):
model_name="evidencesource",
name="source_date",
field=models.DateField(
default=datetime.datetime(2016, 8, 26, 16, 56, 39, 255717, tzinfo=utc),
default=datetime.datetime(
2016, 8, 26, 16, 56, 39, 255717, tzinfo=datetime.timezone.utc
),
verbose_name="source date",
),
preserve_default=False,
Expand Down
8 changes: 3 additions & 5 deletions openach/migrations/0006_evidence_submit_date.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-26 17:29
from __future__ import unicode_literals

import datetime

from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):

dependencies = [
("openach", "0005_evidencesource_source_date"),
]
Expand All @@ -19,7 +15,9 @@ class Migration(migrations.Migration):
model_name="evidence",
name="submit_date",
field=models.DateTimeField(
default=datetime.datetime(2016, 8, 26, 17, 29, 46, 660576, tzinfo=utc),
default=datetime.datetime(
2016, 8, 26, 17, 29, 46, 660576, tzinfo=datetime.timezone.utc
),
verbose_name="date added",
),
preserve_default=False,
Expand Down
8 changes: 3 additions & 5 deletions openach/migrations/0013_hypothesis_submit_date.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-30 03:05
from __future__ import unicode_literals

import datetime

from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):

dependencies = [
("openach", "0012_auto_20160829_2127"),
]
Expand All @@ -19,7 +15,9 @@ class Migration(migrations.Migration):
model_name="hypothesis",
name="submit_date",
field=models.DateTimeField(
default=datetime.datetime(2016, 8, 30, 3, 5, 15, 430181, tzinfo=utc),
default=datetime.datetime(
2016, 8, 30, 3, 5, 15, 430181, tzinfo=datetime.timezone.utc
),
verbose_name="date added",
),
preserve_default=False,
Expand Down
8 changes: 3 additions & 5 deletions openach/migrations/0018_auto_20160919_2318.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-19 23:18
from __future__ import unicode_literals

import datetime

from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):

dependencies = [
("openach", "0017_evaluation_timestamp"),
]
Expand All @@ -19,7 +15,9 @@ class Migration(migrations.Migration):
model_name="evaluation",
name="timestamp",
field=models.DateTimeField(
default=datetime.datetime(2016, 9, 19, 23, 18, 19, 119681, tzinfo=utc),
default=datetime.datetime(
2016, 9, 19, 23, 18, 19, 119681, tzinfo=datetime.timezone.utc
),
verbose_name="date evaluated",
),
preserve_default=False,
Expand Down
9 changes: 3 additions & 6 deletions openach/tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ def test_show_published_news(self):

def test_index_view_with_a_past_board(self):
"""Test that board with a pub_date in the past should be displayed on the index page."""
create_board(board_title="Past board.", days=-30)
board = create_board(board_title="Past board.", days=-30)
response = self.client.get(reverse("openach:index"))
self.assertQuerysetEqual(
response.context["latest_board_list"], ["<Board: Past board.>"]
)
self.assertQuerysetEqual(response.context["latest_board_list"], [board])


class BannerTests(TestCase):
Expand All @@ -56,7 +54,7 @@ def test_show_banner(self):
msg = "Test banner message"
setattr(settings, "BANNER_MESSAGE", msg)
for page in ["index", "boards", "about"]:
response = self.client.get(reverse("openach:{}".format(page)))
response = self.client.get(reverse(f"openach:{page}"))
self.assertContains(response, msg, status_code=200)

def test_do_not_show_empty_banner(self):
Expand All @@ -69,7 +67,6 @@ def test_do_not_show_empty_banner(self):


class AboutViewTests(TestCase):

address = "abc123"

def test_can_render_about_page(self):
Expand Down
1 change: 0 additions & 1 deletion openintel/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def _detect_command(cmd):

USE_I18N = True

USE_L10N = True

USE_TZ = True

Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
beautifulsoup4==4.9.3
celery==5.2.7
dj-database-url==1.2.0
django-allauth==0.52.0
django-allauth==0.54.0
django-bootstrap-form==3.4
django-contrib-comments==2.1.0
django-contrib-comments==2.2.0
django-csp==3.7
django-environ==0.9.0
django-field-history==0.8.0
django-invitations==1.9.3
django-notifications-hq==1.6.0
Django==3.2.17
django-invitations==2.0.0
django-notifications-hq==1.7.0
Django==4.1.7
python-slugify==4.0.1
qrcode==6.1
tldextract==3.4.0
Expand All @@ -22,7 +22,7 @@ django-recaptcha==3.0.0

django-sendgrid-v5==1.1.0
psycopg2-binary==2.9.5
pylibmc==1.6.1
pylibmc==1.6.3
redis==4.4.4
rollbar==0.16.3

Expand All @@ -33,7 +33,7 @@ whitenoise==6.3.0

# dev dependencies

django-webpack-loader==1.8.0
django-webpack-loader==1.8.1
nplusone==1.0.0
pre-commit==2.14.0
django-debug-toolbar==3.2.2
Expand Down

0 comments on commit 16098af

Please sign in to comment.