Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failure on incorrect urls #52

Merged
merged 4 commits into from
May 8, 2014
Merged

Fix failure on incorrect urls #52

merged 4 commits into from
May 8, 2014

Conversation

meshy
Copy link
Contributor

@meshy meshy commented May 8, 2014

No description provided.

@meshy
Copy link
Contributor Author

meshy commented May 8, 2014

@incuna/backend please review

@meshy
Copy link
Contributor Author

meshy commented May 8, 2014

Fixes #43

response = self.client.put(url, data, content_type="application/json")
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

self.assertTrue(hasattr(response, 'accepted_renderer'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can simplify to:

    def test_full_stack_wrong_url(self):
        user = UserFactory.create()
        token = default_token_generator.make_token(user)
        uid = urlsafe_base64_encode(b'0')  # Invaid responses

        view_name = 'user_management_api:password_reset_confirm'
        url = reverse(view_name, kwargs={'uidb64': uid, 'token': token})
        response = self.client.put(url, content_type="application/json")
        self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

        self.assertTrue(hasattr(response, 'accepted_renderer'))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there's no need for me to be passing the correct data as it doesn't get that far. Thanks.

kevinetienne added a commit that referenced this pull request May 8, 2014
Fix failure on incorrect urls
@kevinetienne kevinetienne merged commit 42ab533 into master May 8, 2014
@kevinetienne kevinetienne deleted the odd-error branch May 8, 2014 13:35
@@ -1,3 +1,5 @@
import json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, don't need this now!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I've missed it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So did I, no worries ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants