-
-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade django-money to 3.1. (#1439)
* Added test for meeting details. * Upgraded django-money to 3.1.
- Loading branch information
1 parent
f46f48b
commit e7c6169
Showing
5 changed files
with
46 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
|
@@ -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", "[email protected]", "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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters