Skip to content

Commit

Permalink
Merge pull request #238 from uw-it-aca/task/django4.2
Browse files Browse the repository at this point in the history
Task/django4.2
  • Loading branch information
jlaney authored Sep 19, 2023
2 parents 27e396f + a6a9354 commit 01e30c8
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
python -m pip install --upgrade pip coverage coveralls==2.2.0
python -m pip install --upgrade pip coverage coveralls==3.3.1
coverage combine
coveralls
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG DJANGO_CONTAINER_VERSION=1.4.1

FROM gcr.io/uwit-mci-axdd/django-container:${DJANGO_CONTAINER_VERSION} as app-prebundler-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} as app-prebundler-container

USER root

Expand All @@ -17,7 +17,7 @@ RUN /app/bin/pip install psycopg2
ADD --chown=acait:acait docker/app_start.sh /scripts
RUN chmod u+x /scripts/app_start.sh

FROM node:14.18.1-stretch AS node-bundler
FROM node:lts-bullseye AS node-bundler

ADD ./package.json /app/
WORKDIR /app/
Expand All @@ -36,7 +36,7 @@ COPY --chown=acait:acait --from=node-bundler /app/pathways/static /app/pathways/

RUN . /app/bin/activate && python manage.py collectstatic --noinput

FROM gcr.io/uwit-mci-axdd/django-test-container:${DJANGO_CONTAINER_VERSION} as app-test-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-test-container:${DJANGO_CONTAINER_VERSION} as app-test-container

ENV NODE_PATH=/app/lib/node_modules
COPY --from=app-container /app/ /app/
Expand Down
1 change: 1 addition & 0 deletions docker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BASE_DIR, "pathways", "static", "manifest.json"
)
else:
CSRF_TRUSTED_ORIGINS = ['https://' + os.getenv('CLUSTER_CNAME')]
VITE_MANIFEST_PATH = os.path.join(os.sep, "static", "manifest.json")

# If you have file data, define the path here
Expand Down
3 changes: 2 additions & 1 deletion docker/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .base_urls import *
from django.urls import re_path, include
from django.conf.urls import include
from django.urls import re_path

urlpatterns += [
re_path(r'^', include('pathways.urls'))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@popperjs/core": "^2.11.6",
"axdd-components": "git+https://github.com/uw-it-aca/axdd-components.git#1.0.5",
"axios": "^0.27.2",
"bootstrap": "^5.2.3",
"bootstrap": "5.2.3",
"bootstrap-icons": "^1.10.3",
"d3": "^7.8.2",
"jquery": "^3.6.3",
Expand Down
9 changes: 6 additions & 3 deletions pathways/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
from django.test import RequestFactory, TestCase
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from pathways.data_import import (
import_major_data, import_course_data, import_curric_data)
import mock
import json
from pathways.data_import import import_major_data, import_course_data, \
import_curric_data
import csv


class ApiTest(TestCase):
def setUp(self):
self.request = RequestFactory().get('/')
self.request.user = User()
SessionMiddleware().process_request(self.request)
get_response = mock.MagicMock()
middleware = SessionMiddleware(get_response)
response = middleware(self.request)
self.request.session.save()
with open('pathways/tests/sample_coi_import.json') as coi_file:
reader = csv.reader(coi_file)
Expand Down
5 changes: 4 additions & 1 deletion pathways/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from pathways.views.pages import DefaultPageView
import mock


class PagesViewTest(TestCase):
def setUp(self):
self.request = RequestFactory().get('/')
self.request.user = User()
SessionMiddleware().process_request(self.request)
get_response = mock.MagicMock()
middleware = SessionMiddleware(get_response)
response = middleware(self.request)
self.request.session.save()

def test_context(self):
Expand Down
2 changes: 1 addition & 1 deletion pathways/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

from django.conf import settings
from django.urls import include, path, re_path
from django.urls import re_path
from django.views.generic import TemplateView
from pathways.views.pages import DefaultPageView
from pathways.views.api.major import MajorDetails, MajorList
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
author_email="[email protected]",
include_package_data=True,
install_requires=[
"django~=3.2",
"UW-Django-SAML2~=1.5",
"django~=4.2",
"UW-Django-SAML2~=1.7",
],
license="Apache License, Version 2.0",
description="A tool for visually displaying UW course prerequisites",
Expand Down

0 comments on commit 01e30c8

Please sign in to comment.