-
-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added latest DSF board meeting minutes to complementary sidebar.
- Loading branch information
1 parent
2d19190
commit 4fbcf7d
Showing
6 changed files
with
95 additions
and
20 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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% load i18n %} | ||
<ul class="list-news"> | ||
{% for m in meetings %} | ||
<li> | ||
<h4> | ||
<a href="{{ m.get_absolute_url }}">{{ m }}</a> | ||
</h4> | ||
{% with m.business.all as businesses %} | ||
{% if businesses %} | ||
<div class="meta"> | ||
<b>{% translate "New and Ongoing business" %}</b> | ||
<ul> | ||
{% for b in businesses %} | ||
<li>{{ b.title }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% endwith %} | ||
<a class="link-readmore" href="{{ m.get_absolute_url }}"> | ||
{% translate "Read more" context "Following meeting minutes summary" %} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django import template | ||
|
||
from ..models import Meeting | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.inclusion_tag("foundation/meeting_snippet.html") | ||
def render_latest_meeting_minute_entries(num): | ||
meetings = Meeting.objects.order_by("-date").prefetch_related("business")[:num] | ||
return {"meetings": meetings} |
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 |
---|---|---|
|
@@ -5,13 +5,23 @@ | |
from django.urls import reverse | ||
from djmoney.money import Money | ||
|
||
from .models import ApprovedGrant, BoardMember, Meeting, Office, Term | ||
from .models import ApprovedGrant, BoardMember, Business, Meeting, Office, Term | ||
|
||
|
||
class MeetingTestCase(TestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
cls.user = User.objects.create_superuser( | ||
"admin", "[email protected]", "password" | ||
) | ||
cls.member = BoardMember.objects.create( | ||
account=cls.user, | ||
office=Office.objects.create(name="treasurer"), | ||
term=Term.objects.create(year=2023), | ||
) | ||
|
||
def test_meeting_initial(self): | ||
user = User.objects.create_superuser("admin", "[email protected]", "password") | ||
self.client.force_login(user) | ||
self.client.force_login(self.user) | ||
response = self.client.get(reverse("admin:foundation_meeting_add")) | ||
self.assertContains(response, "DSF Board monthly meeting") | ||
self.assertContains(response, "dsf-board-monthly-meeting") | ||
|
@@ -20,17 +30,11 @@ def test_meeting_minutes_feed(self): | |
""" | ||
Make sure that the meeting minutes RSS feed works | ||
""" | ||
user = User.objects.create_superuser("admin", "[email protected]", "password") | ||
member = BoardMember.objects.create( | ||
account=user, | ||
office=Office.objects.create(name="treasurer"), | ||
term=Term.objects.create(year=2023), | ||
) | ||
Meeting.objects.create( | ||
date=date.today(), | ||
title="DSF Board monthly meeting", | ||
slug="dsf-board-monthly-meeting", | ||
leader=member, | ||
leader=self.member, | ||
treasurer_report="Hello World", | ||
) | ||
|
||
|
@@ -39,18 +43,11 @@ def test_meeting_minutes_feed(self): | |
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, | ||
leader=self.member, | ||
treasurer_report="Hello World", | ||
) | ||
ApprovedGrant.objects.create( | ||
|
@@ -77,3 +74,42 @@ def test_meeting_details(self): | |
self.assertContains(response, "DSF Board monthly meeting") | ||
self.assertContains(response, "USD $10,000.00") | ||
self.assertContains(response, "EUR €5,000.00") | ||
|
||
def test_latest_meeting_minutes(self): | ||
common_meeting_data = { | ||
"slug": "dsf-board-monthly-meeting", | ||
"leader": self.member, | ||
"treasurer_report": "Hello World", | ||
"title": "DSF Board monthly meeting", | ||
} | ||
latest_meeting = Meeting.objects.create( | ||
date=date(2023, 5, 12), **common_meeting_data | ||
) | ||
previous_meeting = Meeting.objects.create( | ||
date=date(2023, 4, 12), **common_meeting_data | ||
) | ||
Meeting.objects.create(date=date(2023, 3, 12), **common_meeting_data) | ||
common_business_data = { | ||
"body": "Example", | ||
"body_html": "Example", | ||
"business_type": "New", | ||
"meeting": latest_meeting, | ||
} | ||
Business.objects.create(title="Business item 1", **common_business_data) | ||
Business.objects.create(title="Business item 2", **common_business_data) | ||
Business.objects.create(title="Business item 3", **common_business_data) | ||
|
||
response = self.client.get(reverse("foundation_meeting_archive_index")) | ||
|
||
self.assertContains(response, "Latest DSF meeting minutes") | ||
|
||
self.assertContains(response, "DSF Board monthly meeting, May 12, 2023") | ||
self.assertContains(response, latest_meeting.get_absolute_url()) | ||
self.assertContains(response, "DSF Board monthly meeting, April 12, 2023") | ||
self.assertContains(response, previous_meeting.get_absolute_url()) | ||
self.assertNotContains(response, "DSF Board monthly meeting, March 12, 2023") | ||
|
||
self.assertContains(response, "New and Ongoing business", count=1) | ||
self.assertContains(response, "Business item 1") | ||
self.assertContains(response, "Business item 2") | ||
self.assertContains(response, "Business item 3") |