From 34e61cafb34aa2ed0f6e487b4eb50a2275a2643a Mon Sep 17 00:00:00 2001 From: "Mees, T.D. (Ty)" Date: Wed, 28 Feb 2024 18:16:58 +0100 Subject: [PATCH 1/3] fix: fix broken tests due to invalid fixture names --- proposals/tests/misc_tests.py | 2 +- proposals/tests/proposal_submission_tests.py | 4 ++-- reviews/tests.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proposals/tests/misc_tests.py b/proposals/tests/misc_tests.py index 4498f9dcd..0d8c57677 100644 --- a/proposals/tests/misc_tests.py +++ b/proposals/tests/misc_tests.py @@ -26,7 +26,7 @@ class MiscProposalTestCase(TestCase): "compensations", "recruitments", "settings", - "registrations", + "00_registrations", "groups", "institutions", ] diff --git a/proposals/tests/proposal_submission_tests.py b/proposals/tests/proposal_submission_tests.py index 999c33f14..7ea5d426a 100644 --- a/proposals/tests/proposal_submission_tests.py +++ b/proposals/tests/proposal_submission_tests.py @@ -28,8 +28,8 @@ class BaseProposalTestCase(TestCase): "recruitments", "specialdetails", "traits", - "registrationkinds", - "registrations", + "00_registrations", + "01_registrationkinds", "testing/test_users", "testing/test_proposals", ] diff --git a/reviews/tests.py b/reviews/tests.py index e4b685cfc..6942333ed 100644 --- a/reviews/tests.py +++ b/reviews/tests.py @@ -30,8 +30,8 @@ class BaseReviewTestCase(TestCase): fixtures = [ "relations", "compensations", - "registrations", - "registrationkinds", + "00_registrations", + "01_registrationkinds", "agegroups", "groups", "institutions", From 35373161debd3f686ae62ccde3bf8e5187f15d39 Mon Sep 17 00:00:00 2001 From: "Mees, T.D. (Ty)" Date: Wed, 28 Feb 2024 18:21:35 +0100 Subject: [PATCH 2/3] refactor: remove unknown-font-weight warnings Turns out our PDF generator has a pretty strange CSS parser that does not allow `font-weight: 400` (as 400 is the default). --- proposals/templates/proposals/proposal_pdf.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/proposals/templates/proposals/proposal_pdf.html b/proposals/templates/proposals/proposal_pdf.html index 3239d54d2..423850555 100644 --- a/proposals/templates/proposals/proposal_pdf.html +++ b/proposals/templates/proposals/proposal_pdf.html @@ -11,7 +11,6 @@ @font-face { font-family: "Open Sans"; src: url('proposals/static/proposals/pdf_font/OpenSans-Regular.ttf'); - font-weight: 400; } @font-face { @@ -23,7 +22,6 @@ @font-face { font-family: "Open Sans"; src: url('proposals/static/proposals/pdf_font/OpenSans-Italic.ttf'); - font-weight: 400; font-style: italic; } From 344e96003e9267d87098543290d5efe851fe6713 Mon Sep 17 00:00:00 2001 From: "Mees, T.D. (Ty)" Date: Wed, 28 Feb 2024 18:27:42 +0100 Subject: [PATCH 3/3] fix: disable PDF warnings durings tests --- proposals/tests/proposal_submission_tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proposals/tests/proposal_submission_tests.py b/proposals/tests/proposal_submission_tests.py index 7ea5d426a..40a215baa 100644 --- a/proposals/tests/proposal_submission_tests.py +++ b/proposals/tests/proposal_submission_tests.py @@ -1,7 +1,8 @@ +import logging + from django.contrib.auth.models import User, Group, AnonymousUser from django.conf import settings from django.test import TestCase -from django.core.management import call_command from main.tests import BaseViewTestCase from proposals.models import Proposal, Relation @@ -38,6 +39,11 @@ def setUp(self): self.setup_users() self.setup_proposal() + # Disable logging warnings and all levels below + # Our (pdf) code logs warnings that are not relevant to the tests + # ERROR and CRITICAL are still logged + logging.disable(logging.WARN) + def setup_users(self): self.secretary = User.objects.create_user( "secretary",