Skip to content

Commit

Permalink
Django 4.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan-CTL committed May 13, 2024
1 parent 18e8156 commit babbe9a
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion portfolio/main/management/commands/integrationserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Command(BaseCommand):
"""Build out the basic site tree"""
help = 'Runs a development server with data created by factories.'

requires_system_checks = False
requires_system_checks = [True]

def add_arguments(self, parser):
parser.add_argument(
Expand Down
10 changes: 5 additions & 5 deletions portfolio/main/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def setUp(self):
self.mapper = WagtailEditorMapper()

def test_map_regular_user(self):
self.assertEquals(self.user.groups.count(), 0)
self.assertEqual(self.user.groups.count(), 0)
self.mapper.map(self.user, ['foo', 'bar', 'baz'])
self.assertEquals(self.user.groups.count(), 0)
self.assertEqual(self.user.groups.count(), 0)

def test_map_privileged_user(self):
self.assertEquals(self.user.groups.count(), 0)
self.assertEqual(self.user.groups.count(), 0)
self.mapper.map(self.user, ['foo', 'foo.bar.local:columbia.edu'])
self.assertEquals(self.user.groups.count(), 1)
self.assertEquals(self.user.groups.first(), self.editor)
self.assertEqual(self.user.groups.count(), 1)
self.assertEqual(self.user.groups.first(), self.editor)
42 changes: 21 additions & 21 deletions portfolio/main/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ def test_entries(self):
h = HomePage()
qs = h.entries()

self.assertEquals(qs.count(), 1)
self.assertEquals(qs.first(), e)
self.assertEqual(qs.count(), 1)
self.assertEqual(qs.first(), e)

def test_featured_entries(self):
EntryFactory(feature_on_homepage=False, path='0002')
e = EntryFactory(feature_on_homepage=True, path='0003')
h = HomePage()
qs = h.featured_entries()

self.assertEquals(qs.count(), 1)
self.assertEquals(qs.first(), e)
self.assertEqual(qs.count(), 1)
self.assertEqual(qs.first(), e)


class VisualIndexTest(TestCase):
Expand All @@ -36,8 +36,8 @@ def test_get_context(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEquals(ctx['entries'].object_list.first(), e)
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['entries'].object_list.first(), e)

def test_get_context_search(self):
EntryFactory(live=False, path='0002')
Expand All @@ -49,10 +49,10 @@ def test_get_context_search(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['q'], 'foo')
self.assertEquals(ctx['entries'].object_list.count(), 1)
self.assertEquals(ctx['entries'].object_list.first(), e3)
self.assertEqual(ctx['entries'].object_list.count(), 1)
self.assertEqual(ctx['entries'].object_list.first(), e3)

def test_get_context_search_partner(self):
EntryFactory(live=False, path='0002')
Expand All @@ -70,10 +70,10 @@ def test_get_context_search_partner(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['q'], 'moriarty')
self.assertEquals(ctx['entries'].object_list.count(), 1)
self.assertEquals(ctx['entries'].object_list.first(), e3)
self.assertEqual(ctx['entries'].object_list.count(), 1)
self.assertEqual(ctx['entries'].object_list.first(), e3)

def test_get_context_search_description(self):
EntryFactory(live=False, path='0002')
Expand All @@ -85,10 +85,10 @@ def test_get_context_search_description(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['q'], 'baz')
self.assertEquals(ctx['entries'].object_list.count(), 1)
self.assertEquals(ctx['entries'].object_list.first(), e3)
self.assertEqual(ctx['entries'].object_list.count(), 1)
self.assertEqual(ctx['entries'].object_list.first(), e3)

def test_get_context_search_project_type(self):
pt = ProjectTypeFactory(name='MOOC')
Expand All @@ -101,10 +101,10 @@ def test_get_context_search_project_type(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['type'], 'mooc')
self.assertEquals(ctx['entries'].object_list.count(), 1)
self.assertEquals(ctx['entries'].object_list.first(), e3)
self.assertEqual(ctx['entries'].object_list.count(), 1)
self.assertEqual(ctx['entries'].object_list.first(), e3)

def test_get_context_search_award_type(self):
award = AwardTypeFactory(name='Innovative Course Design')
Expand All @@ -117,10 +117,10 @@ def test_get_context_search_award_type(self):

ctx = v.get_context(r)

self.assertEquals(ctx['sort'], 'releasedate')
self.assertEqual(ctx['sort'], 'releasedate')
self.assertEqual(ctx['award'], 'innovative course design')
self.assertEquals(ctx['entries'].object_list.count(), 1)
self.assertEquals(ctx['entries'].object_list.first(), e3)
self.assertEqual(ctx['entries'].object_list.count(), 1)
self.assertEqual(ctx['entries'].object_list.first(), e3)


class EntryPageTest(TestCase):
Expand Down
12 changes: 6 additions & 6 deletions portfolio/main/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def test_published_entries_by_date(self):

qs = published_entries_by_date()

self.assertEquals(qs.count(), 2)
self.assertEquals(qs[0], e1)
self.assertEquals(qs[1], e2)
self.assertEqual(qs.count(), 2)
self.assertEqual(qs[0], e1)
self.assertEqual(qs[1], e2)

def test_featured_entries(self):

Expand All @@ -31,6 +31,6 @@ def test_featured_entries(self):

qs = featured_entries_by_slot()

self.assertEquals(qs.count(), 2)
self.assertEquals(qs[0], e2)
self.assertEquals(qs[1], e1)
self.assertEqual(qs.count(), 2)
self.assertEqual(qs[0], e2)
self.assertEqual(qs[1], e1)
4 changes: 2 additions & 2 deletions portfolio/main/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def setUp(self):

def test_root(self):
response = self.c.get("/")
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_smoketest(self):
response = self.c.get("/smoketest/")
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'PASS')
5 changes: 2 additions & 3 deletions portfolio/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.urls import include, path, re_path
Expand All @@ -22,15 +21,15 @@
}

urlpatterns = [
url(r'^accounts/', include('django.contrib.auth.urls')),
re_path(r'^accounts/', include('django.contrib.auth.urls')),
path('cas/login', cas_views.LoginView.as_view(),
name='cas_ng_login'),
path('cas/logout', cas_views.LogoutView.as_view(),
name='cas_ng_logout'),
path('admin/', admin.site.urls),
path('stats/', TemplateView.as_view(template_name="stats.html")),
path('smoketest/', include('smoketest.urls')),
url(r'^_impersonate/', include('impersonate.urls')),
re_path(r'^_impersonate/', include('impersonate.urls')),
re_path(r'^uploads/(?P<path>.*)$',
serve, {'document_root': settings.MEDIA_ROOT}),
path('cms/', include(wagtailadmin_urls)),
Expand Down
14 changes: 10 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Django>=3.2.14,<4
Django==4.2.11

pytz==2024.1
httplib2==0.22.0
feedparser==6.0.8
Markdown==3.6
psycopg2==2.9.6
psycopg==3.1.19
Pillow==10.3.0
versiontools==1.9.1
statsd==4.0.1
Expand Down Expand Up @@ -63,11 +63,10 @@ django-debug-toolbar==4.3.0
django-waffle==4.1.0

django-smoketest==1.2.0
django-extensions==3.2.0
django-extensions==3.2.1
django-stagingcontext==0.1.0
django-ga-context==0.1.0
django-impersonate==1.9.1
django-markwhat==1.6.2
gunicorn==22.0.0
django-storages==1.14.2

Expand Down Expand Up @@ -127,3 +126,10 @@ django-cas-ng==5.0.0
telepath==0.3
django-smtp-ssl==1.0
asgiref==3.8.0

backports.zoneinfo;python_version<"3.9"
tinycss2==1.2.1 # django-markdownify
bleach==6.0.0 # django-markdownify
django-markdownify==0.9.5

django-courseaffils==2.4.0

0 comments on commit babbe9a

Please sign in to comment.