Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Test Time View Tests

Aksel Stadel Borum
Aksel Stadel Borum
6,659 Points

Django: View Tests. My test isn't running

I've pretty much copied Kenneth's code to my own computer but the test for the course list view isn't running.

It said that the django.core.urlresolvers didn't exist, so I looked it up and changed it to: from django.urls import reverse

Has something else changed that would make Kenneth's code not work any longer or do I have a typo somewhere? :( I've gone through it a bunch of times and everything has worked up until now..

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Be careful of Django versions. In the latest Django 2.0 reverse() is now in django.urls, but in Django 1.11 and earlier reverse() was in django.core.urlresolvers. The old location was deprecated in 1.10, but available in both location in Django 1.10 and 1.11. The old location was fully removed in Django 2.0

This course video was based on Python version (3.5.0) and Django version (1.9.9) which uses the older syntax.

Treehouse is in the process of updating the content of their courses, but this is a continuous effort as new version continue to be released. One why to be sure to be compatible with the video content is to use the Workspaces provided with each video.