-
Notifications
You must be signed in to change notification settings - Fork 64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments
@@ -31,5 +32,5 @@ def test_detail_uuid_exception(self): | |||
""" | |||
see https://github.com/interop-dev/django-netjsongraph/issues/4 | |||
""" | |||
response = self.client.get('/topology/a083b494-8e16-4054-9537-fb9eba914861-wrong/') | |||
response = get_topology_or_404('/topology/a083b494-8e16-4054-9537-fb9eba914861-wrong/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shall not change this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Does self.client.get automatically call get_topology_or_404?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.client.get
simulates an HTTP request to the view, see the django docs regarding the test client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I see
django_netjsongraph/utils.py
Outdated
@@ -61,5 +62,5 @@ def get_topology_or_404(pk, **kwargs): | |||
}) | |||
try: | |||
return get_object_or_404(Topology, **kwargs) | |||
except ValueError: | |||
except (ValidationError, ValueError) as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't add as e
, is not needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will remove
11b937f
to
c258d7a
Compare
No description provided.