-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [Fix] intervention date filter and add intervention years filter
- Loading branch information
Showing
12 changed files
with
131 additions
and
16 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -83,6 +83,9 @@ msgstr "" | |
msgid "end date" | ||
msgstr "" | ||
|
||
msgid "Year" | ||
msgstr "" | ||
|
||
msgid "On" | ||
msgstr "" | ||
|
||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -83,6 +83,9 @@ msgstr "" | |
msgid "end date" | ||
msgstr "" | ||
|
||
msgid "Year" | ||
msgstr "" | ||
|
||
msgid "On" | ||
msgstr "" | ||
|
||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -83,6 +83,9 @@ msgstr "" | |
msgid "end date" | ||
msgstr "" | ||
|
||
msgid "Year" | ||
msgstr "" | ||
|
||
msgid "On" | ||
msgstr "" | ||
|
||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -74,13 +74,16 @@ msgid "Filter by begin date range" | |
msgstr "Filtrer par intervalle de date de début" | ||
|
||
msgid "begin date" | ||
msgstr "date de début" | ||
msgstr "date début" | ||
|
||
msgid "Filter by end date range" | ||
msgstr "Filtrer par intervalle de date de fin" | ||
|
||
msgid "end date" | ||
msgstr "date de fin" | ||
msgstr "date fin" | ||
|
||
msgid "Year" | ||
msgstr "Année" | ||
|
||
msgid "On" | ||
msgstr "Sur" | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -83,6 +83,9 @@ msgstr "" | |
msgid "end date" | ||
msgstr "" | ||
|
||
msgid "Year" | ||
msgstr "" | ||
|
||
msgid "On" | ||
msgstr "" | ||
|
||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-11 15:38+0000\n" | ||
"POT-Creation-Date: 2024-02-05 08:27+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -83,6 +83,9 @@ msgstr "" | |
msgid "end date" | ||
msgstr "" | ||
|
||
msgid "Year" | ||
msgstr "" | ||
|
||
msgid "On" | ||
msgstr "" | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from django.test import TestCase | ||
from geotrek.maintenance.models import Intervention | ||
from geotrek.maintenance.tests.factories import InterventionFactory | ||
|
||
|
||
class InterventionManagerTest(TestCase): | ||
|
||
def test_intervention_with_not_end_date(self): | ||
InterventionFactory(name="test1", begin_date="2020-06-03") | ||
InterventionFactory(name="test2", begin_date="2022-06-03") | ||
self.assertEqual(Intervention.objects.year_choices(), [(2020, 2020), (2022, 2022)]) | ||
|
||
def test_intervention_with_end_date(self): | ||
InterventionFactory(name="test1", begin_date="2018-06-03", end_date="2020-06-03") | ||
InterventionFactory(name="test2", begin_date="2022-06-03", end_date="2024-06-03") | ||
self.assertEqual(Intervention.objects.year_choices(), [(2018, 2018), (2019, 2019), (2020, 2020), (2022, 2022), (2023, 2023), (2024, 2024)]) | ||
|
||
def test_intervention_with_one_have_end_date(self): | ||
InterventionFactory(name="test1", begin_date="2020-06-03") | ||
InterventionFactory(name="test2", begin_date="2022-06-03", end_date="2024-06-03") | ||
self.assertEqual(Intervention.objects.year_choices(), [(2020, 2020), (2022, 2022), (2023, 2023), (2024, 2024)]) | ||
|
||
def test_intervention_return_distinct_year(self): | ||
InterventionFactory(name="test1", begin_date="2020-06-03") | ||
InterventionFactory(name="test2", begin_date="2018-06-03", end_date="2024-06-03") | ||
self.assertEqual(Intervention.objects.year_choices(), [(2018, 2018), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023), (2024, 2024)]) |