-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: merge main to release
- Loading branch information
Showing
32 changed files
with
34 additions
and
2,397 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ghcr.io/ietf-tools/datatracker-app-base:20241127T2054 | ||
FROM ghcr.io/ietf-tools/datatracker-app-base:20241212T1741 | ||
LABEL maintainer="IETF Tools Team <[email protected]>" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
20241127T2054 | ||
20241212T1741 |
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
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 |
---|---|---|
|
@@ -809,8 +809,8 @@ def skip_unreadable_post(record): | |
SESSION_REQUEST_FROM_EMAIL = 'IETF Meeting Session Request Tool <[email protected]>' | ||
|
||
SECRETARIAT_SUPPORT_EMAIL = "[email protected]" | ||
SECRETARIAT_ACTION_EMAIL = "[email protected]" | ||
SECRETARIAT_INFO_EMAIL = "[email protected]" | ||
SECRETARIAT_ACTION_EMAIL = SECRETARIAT_SUPPORT_EMAIL | ||
SECRETARIAT_INFO_EMAIL = SECRETARIAT_SUPPORT_EMAIL | ||
|
||
# Put real password in settings_local.py | ||
IANA_SYNC_PASSWORD = "secret" | ||
|
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 |
---|---|---|
|
@@ -13,22 +13,16 @@ | |
import debug # pyflakes:ignore | ||
|
||
from django.urls import reverse as urlreverse | ||
from django.utils import timezone | ||
|
||
from ietf.utils.test_utils import login_testing_unauthorized, TestCase | ||
import ietf.stats.views | ||
|
||
from ietf.submit.models import Submission | ||
from ietf.doc.factories import WgDraftFactory, WgRfcFactory | ||
from ietf.doc.models import Document, State, RelatedDocument, NewRevisionDocEvent, DocumentAuthor | ||
|
||
from ietf.group.factories import RoleFactory | ||
from ietf.meeting.factories import MeetingFactory, AttendedFactory | ||
from ietf.meeting.factories import MeetingFactory | ||
from ietf.person.factories import PersonFactory | ||
from ietf.person.models import Person, Email | ||
from ietf.name.models import FormalLanguageName, DocRelationshipName, CountryName | ||
from ietf.review.factories import ReviewRequestFactory, ReviewerSettingsFactory, ReviewAssignmentFactory | ||
from ietf.stats.models import MeetingRegistration, CountryAlias | ||
from ietf.stats.factories import MeetingRegistrationFactory | ||
from ietf.stats.models import MeetingRegistration | ||
from ietf.stats.tasks import fetch_meeting_attendance_task | ||
from ietf.stats.utils import get_meeting_registration_data, FetchStats, fetch_attendance_from_meetings | ||
from ietf.utils.timezone import date_today | ||
|
@@ -41,121 +35,14 @@ def test_stats_index(self): | |
self.assertEqual(r.status_code, 200) | ||
|
||
def test_document_stats(self): | ||
WgRfcFactory() | ||
draft = WgDraftFactory() | ||
DocumentAuthor.objects.create( | ||
document=draft, | ||
person=Person.objects.get(email__address="[email protected]"), | ||
email=Email.objects.get(address="[email protected]"), | ||
country="Germany", | ||
affiliation="IETF", | ||
order=1 | ||
) | ||
|
||
# create some data for the statistics | ||
Submission.objects.create( | ||
authors=[ { "name": "Some Body", "email": "[email protected]", "affiliation": "Some Inc.", "country": "US" }], | ||
pages=30, | ||
rev=draft.rev, | ||
words=4000, | ||
draft=draft, | ||
file_types=".txt", | ||
state_id="posted", | ||
) | ||
|
||
draft.formal_languages.add(FormalLanguageName.objects.get(slug="xml")) | ||
Document.objects.filter(pk=draft.pk).update(words=4000) | ||
# move it back so it shows up in the yearly summaries | ||
NewRevisionDocEvent.objects.filter(doc=draft, rev=draft.rev).update( | ||
time=timezone.now() - datetime.timedelta(days=500)) | ||
|
||
referencing_draft = Document.objects.create( | ||
name="draft-ietf-mars-referencing", | ||
type_id="draft", | ||
title="Referencing", | ||
stream_id="ietf", | ||
abstract="Test", | ||
rev="00", | ||
pages=2, | ||
words=100 | ||
) | ||
referencing_draft.set_state(State.objects.get(used=True, type="draft", slug="active")) | ||
RelatedDocument.objects.create( | ||
source=referencing_draft, | ||
target=draft, | ||
relationship=DocRelationshipName.objects.get(slug="refinfo") | ||
) | ||
NewRevisionDocEvent.objects.create( | ||
type="new_revision", | ||
by=Person.objects.get(name="(System)"), | ||
doc=referencing_draft, | ||
desc="New revision available", | ||
rev=referencing_draft.rev, | ||
time=timezone.now() - datetime.timedelta(days=1000) | ||
) | ||
r = self.client.get(urlreverse("ietf.stats.views.document_stats")) | ||
self.assertRedirects(r, urlreverse("ietf.stats.views.stats_index")) | ||
|
||
|
||
# check redirect | ||
url = urlreverse(ietf.stats.views.document_stats) | ||
|
||
authors_url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": "authors" }) | ||
|
||
r = self.client.get(url) | ||
self.assertEqual(r.status_code, 302) | ||
self.assertTrue(authors_url in r["Location"]) | ||
|
||
# check various stats types | ||
for stats_type in ["authors", "pages", "words", "format", "formlang", | ||
"author/documents", "author/affiliation", "author/country", | ||
"author/continent", "author/citations", "author/hindex", | ||
"yearly/affiliation", "yearly/country", "yearly/continent"]: | ||
for document_type in ["", "rfc", "draft"]: | ||
for time_choice in ["", "5y"]: | ||
url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": stats_type }) | ||
r = self.client.get(url, { | ||
"type": document_type, | ||
"time": time_choice, | ||
}) | ||
self.assertEqual(r.status_code, 200) | ||
q = PyQuery(r.content) | ||
self.assertTrue(q('#chart')) | ||
if not stats_type.startswith("yearly"): | ||
self.assertTrue(q('table.stats-data')) | ||
|
||
def test_meeting_stats(self): | ||
# create some data for the statistics | ||
meeting = MeetingFactory(type_id='ietf', date=date_today(), number="96") | ||
MeetingRegistrationFactory(first_name='John', last_name='Smith', country_code='US', email="[email protected]", meeting=meeting, attended=True) | ||
CountryAlias.objects.get_or_create(alias="US", country=CountryName.objects.get(slug="US")) | ||
p = MeetingRegistrationFactory(first_name='Jaume', last_name='Guillaume', country_code='FR', email="[email protected]", meeting=meeting, attended=False).person | ||
CountryAlias.objects.get_or_create(alias="FR", country=CountryName.objects.get(slug="FR")) | ||
AttendedFactory(session__meeting=meeting,person=p) | ||
# check redirect | ||
url = urlreverse(ietf.stats.views.meeting_stats) | ||
|
||
authors_url = urlreverse(ietf.stats.views.meeting_stats, kwargs={ "stats_type": "overview" }) | ||
|
||
r = self.client.get(url) | ||
self.assertEqual(r.status_code, 302) | ||
self.assertTrue(authors_url in r["Location"]) | ||
|
||
# check various stats types | ||
for stats_type in ["overview", "country", "continent"]: | ||
url = urlreverse(ietf.stats.views.meeting_stats, kwargs={ "stats_type": stats_type }) | ||
r = self.client.get(url) | ||
self.assertEqual(r.status_code, 200) | ||
q = PyQuery(r.content) | ||
self.assertTrue(q('#chart')) | ||
if stats_type == "overview": | ||
self.assertTrue(q('table.stats-data')) | ||
r = self.client.get(urlreverse("ietf.stats.views.meeting_stats")) | ||
self.assertRedirects(r, urlreverse("ietf.stats.views.stats_index")) | ||
|
||
for stats_type in ["country", "continent"]: | ||
url = urlreverse(ietf.stats.views.meeting_stats, kwargs={ "stats_type": stats_type, "num": meeting.number }) | ||
r = self.client.get(url) | ||
self.assertEqual(r.status_code, 200) | ||
q = PyQuery(r.content) | ||
self.assertTrue(q('#chart')) | ||
self.assertTrue(q('table.stats-data')) | ||
|
||
def test_known_country_list(self): | ||
# check redirect | ||
|
Oops, something went wrong.