Skip to content

Commit

Permalink
Merge branch 'main' into gazette-special-facet
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed Sep 5, 2024
2 parents 65a1377 + 5126311 commit 9580ab1
Show file tree
Hide file tree
Showing 29 changed files with 3,625 additions and 3,445 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ jobs:
sudo apt-get install -y libreoffice poppler-utils
python -m pip install --upgrade setuptools wheel
pip install .
pip install psycopg2-binary==2.9.3
pip install psycopg2-binary==2.9.3 unittest-xml-reporting
npm ci --no-audit --ignore-scripts --only=prod
npm i -g sass
- name: Lint and Run tests
- name: Run tests
env:
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/peach-jam"
TEST_RUNNER: "xmlrunner.extra.djangotestrunner.XMLTestRunner"
run: |
pre-commit run --all-files
python manage.py test ${{ matrix.app }} --settings=${{ matrix.app }}.settings
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: success() || failure()
continue-on-error: true
with:
files: test-reports/*.xml
2 changes: 1 addition & 1 deletion africanlii/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class AfricanliiViewsTest(TestCase):
fixtures = ["documents/sample_documents"]
fixtures = ["tests/countries", "documents/sample_documents"]

def test_homepage(self):
response = self.client.get("/")
Expand Down
6 changes: 3 additions & 3 deletions africanlii/views/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ def add_facets(self, context):
"jurisdictions": {
"label": _("Judrisdictions"),
"type": "checkbox",
"options": [j for j, n, x in res.facets.jurisdiction],
"options": [(j, j) for j, n, x in res.facets.jurisdiction],
"values": self.request.GET.getlist("jurisdictions"),
},
"years": {
"label": _("Years"),
"type": "checkbox",
"options": [
str(y) for y, n, x in sorted(res.facets.year, reverse=True)
(str(y), y) for y, n, x in sorted(res.facets.year, reverse=True)
],
"values": self.request.GET.getlist("years"),
},
"alphabet": {
"label": _("Alphabet"),
"type": "radio",
"options": lowercase_alphabet(),
"options": [(a, a) for a in lowercase_alphabet()],
"values": self.request.GET.get("alphabet"),
},
}
Expand Down
Loading

0 comments on commit 9580ab1

Please sign in to comment.