I have started writing a page to to display a photo. This page correctly display the photo data (nb. no photo added yet) as well as the 'Invalid item ID' message if an invalid value has been requested. The HTML code is in 'photos.html' is as follows:
I am now trying to start testing the above function by using the following test function in tests_views.py:
class PhotosByLocationIndexViewTests
(TestCase): """
testing 'def photo(requeset)'
"""
def test_for_no_photos_in_photos(
self): # 'photourl' is in 'wlp_app/urls.py'
response = self.client.get(reverse('
photourl'))
The 'photourl' name that is called by the 'reverse' function above is in the urls.py:
urlpatterns = [
url(r'^$', views.index, name='indexurl'),
url(r'^photo/(?P<photo_id>[0-
9]+)/$', views.photo, name='photourl') ]
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVzNZ5HkN5h_qFDcHVOvLosO1mh9K1VrzbaUP%2BgAn1PsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment