Skip to content

Commit

Permalink
Upgrade django dependant libraries in preparation for 4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahboyce committed Nov 29, 2023
1 parent 750a559 commit e2b3bb8
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 62 deletions.
6 changes: 3 additions & 3 deletions contact/forms.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import logging

import django
from captcha.fields import ReCaptchaField
from captcha.widgets import ReCaptchaV3
from contact_form.forms import ContactForm
from django import forms
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.encoding import force_bytes
from django_contact_form.forms import ContactForm
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV3
from pykismet3 import Akismet, AkismetServerError

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion contact/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from contact_form.views import ContactFormView
from django.urls import reverse
from django_contact_form.views import ContactFormView

from .forms import FoundationContactForm

Expand Down
2 changes: 1 addition & 1 deletion djangoproject/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"svntogit",
"tracdb",
"fundraising",
"captcha",
"django_recaptcha",
"registration",
"django_hosts",
"sorl.thumbnail",
Expand Down
2 changes: 1 addition & 1 deletion djangoproject/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
"djangoproject.middleware.CORSMiddleware",
)

SILENCED_SYSTEM_CHECKS = ["captcha.recaptcha_test_key_error"]
SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"]
2 changes: 1 addition & 1 deletion djangoproject/settings/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
SECRET_KEY = os.environ.get("SECRET_KEY")

SILENCED_SYSTEM_CHECKS = SILENCED_SYSTEM_CHECKS + [
"captcha.recaptcha_test_key_error" # Default test keys for development.
"django_recaptcha.recaptcha_test_key_error" # Default test keys for development.
]

ALLOWED_HOSTS = [".localhost", "127.0.0.1", "www.127.0.0.1"]
Expand Down
6 changes: 3 additions & 3 deletions djangoproject/templates/foundation/meeting_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block og_description %}Meeting minutes for {{ meeting }}{% endblock %}

{% block content %}
{% load foundation %}
{% load djmoney %}

<h1>{{ meeting }}</h1>

Expand Down Expand Up @@ -32,7 +32,7 @@ <h2>Finances</h2>

<h3>Balance</h3>

<p>{{ meeting.treasurer_balance|currency }}</p>
<p>{{ meeting.treasurer_balance.currency.code }} {% money_localize meeting.treasurer_balance %}</p>

{% if meeting.treasurer_report %}
<h3>Treasurer&#8217;s report</h3>
Expand All @@ -44,7 +44,7 @@ <h2>Grants approved </h2>

<ul>
{% for grant in meeting.grants_approved.all %}
<li>{{ grant.entity }}: {{ grant.amount|currency }}</li>
<li>{{ grant.entity }}: {{ grant.amount.currency.code }} {% money_localize grant.amount %}</li>
{% endfor %}
</ul>
{% endif %}
Expand Down
24 changes: 24 additions & 0 deletions foundation/migrations/0005_auto_20231129_0428.py

Large diffs are not rendered by default.

Empty file.
44 changes: 0 additions & 44 deletions foundation/templatetags/foundation.py

This file was deleted.

43 changes: 42 additions & 1 deletion foundation/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
from djmoney.money import Money

from .models import BoardMember, Meeting, Office, Term
from .models import ApprovedGrant, BoardMember, Meeting, Office, Term


class MeetingTestCase(TestCase):
Expand Down Expand Up @@ -36,3 +37,43 @@ def test_meeting_minutes_feed(self):
response = self.client.get(reverse("foundation-minutes-feed"))
self.assertEqual(response.status_code, 200)
self.assertIn(b"DSF Board monthly meeting", response.content)

def test_meeting_details(self):
user = User.objects.create_superuser("admin", "admin@example.com", "password")
self.client.force_login(user)
member = BoardMember.objects.create(
account=user,
office=Office.objects.create(name="treasurer"),
term=Term.objects.create(year=2023),
)
meeting = Meeting.objects.create(
date=date(2023, 1, 12),
title="DSF Board monthly meeting",
slug="dsf-board-monthly-meeting",
leader=member,
treasurer_report="Hello World",
)
ApprovedGrant.objects.create(
entity="Django girls",
amount=Money("10000", "USD"),
approved_at=meeting,
)
ApprovedGrant.objects.create(
entity="DjangoCon EU",
amount=Money(5000, "EUR"),
approved_at=meeting,
)
response = self.client.get(
reverse(
"foundation_meeting_detail",
kwargs={
"year": 2023,
"month": "jan",
"day": 12,
"slug": "dsf-board-monthly-meeting",
},
)
)
self.assertContains(response, "DSF Board monthly meeting")
self.assertContains(response, "USD $10,000.00")
self.assertContains(response, "EUR €5,000.00")
4 changes: 2 additions & 2 deletions fundraising/forms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import stripe
from captcha.fields import ReCaptchaField
from captcha.widgets import ReCaptchaV3
from django import forms
from django.utils.safestring import mark_safe
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV3

from .models import INTERVAL_CHOICES, LEADERSHIP_LEVEL_AMOUNT, DjangoHero, Donation

Expand Down
10 changes: 5 additions & 5 deletions requirements/common.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Babel==2.10.1
django-contact-form==1.9
django-contact-form==2.1
django-countries==7.5.1
django-hosts==5.1
django-money==2.1.1
django-money==3.4
django-push==1.1
django-read-only==1.12.0
django-recaptcha==3.0.0
django-registration-redux==2.10
django-read-only==1.15.0
django-recaptcha==4.0.0
django-registration-redux==2.13
Django==3.2.20
docutils==0.17.1
feedparser==6.0.8
Expand Down

0 comments on commit e2b3bb8

Please sign in to comment.