You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tests for Chapter 5 are producing the error message on line 178 of the tests_chapter5.py file. The error message reads:
"We couldn't find the correct output in the Page view within the admin interface for page listings. Did you complete the exercises, adding extra columns to the admin view for this model? Are the columns in the correct order?"
I can see that the pertinent test checks whether expected_str is in response_body. When I print response_body, the string is identical to expected_str except for the start of the string, which begins instead of , but everything else is the same.
I.e. response_body reads:
instead of:
The code in my admin.py file for the project reads as follows:
"from django.contrib import admin
from rango.models import Category, Page
class PageAdmin (admin.ModelAdmin):
list_display = ('title', 'category', 'url')
which matches the code suggested in the Excercise Hints part of the book on Page 89. The code also produces the correct Pages view on the /admin/ site:
The above is a screenshot of the /admin/ page from my project which exactly matches the screenshot on page 88 of the book.
I am running a later version of Django than suggested in the book (4.1), which perhaps explains this error.
Can you please confirm whether there is something wrong with my implementation or whether the error is produced due to external reasons (e.g. using a later version of Django)? Thanks in advance for your help!
The text was updated successfully, but these errors were encountered:
The tests for Chapter 5 are producing the error message on line 178 of the tests_chapter5.py file. The error message reads:
"We couldn't find the correct output in the Page view within the admin interface for page listings. Did you complete the exercises, adding extra columns to the admin view for this model? Are the columns in the correct order?"
I can see that the pertinent test checks whether expected_str is in response_body. When I print response_body, the string is identical to expected_str except for the start of the string, which begins instead of , but everything else is the same.
I.e. response_body reads:
instead of:
The code in my admin.py file for the project reads as follows:
"from django.contrib import admin
from rango.models import Category, Page
class PageAdmin (admin.ModelAdmin):
list_display = ('title', 'category', 'url')
Register your models here.
admin.site.register(Category)
admin.site.register(Page,PageAdmin)"
which matches the code suggested in the Excercise Hints part of the book on Page 89. The code also produces the correct Pages view on the /admin/ site:
The above is a screenshot of the /admin/ page from my project which exactly matches the screenshot on page 88 of the book.
I am running a later version of Django than suggested in the book (4.1), which perhaps explains this error.
Can you please confirm whether there is something wrong with my implementation or whether the error is produced due to external reasons (e.g. using a later version of Django)? Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: