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

Deal with bare except statements. See #1540. #1541

Merged
merged 1 commit into from Feb 5, 2018

Conversation

@pawelswiecki
Copy link
Contributor

pawelswiecki commented Jan 16, 2018

Notes about the changes:

  • tastypie.authentication.Authentication.get_authorization_data change

    This is about re-raising the ValueError with a custom message in case of
    .split() returning one item (instead of two). Made it explicit.

  • tastypie.resources.BaseModelResource.obj_update change

    I left this as is, because pinpointing all the possible exceptions that
    may be raised during data hydration is error-prone. "# flake8: noqa"
    prevents flake8 error.

  • tests.core.tests.resources.ResourceTestCase.test_auth_check change

    BasicResource.is_authenticated() (without a custom authentication defined
    in "meta") can only raise ImmediateHttpResponse exception. Catch it
    explicitly.

  • tests.core.tests.resources.ModelResourceTestCase.test_is_valid change

    Current implementation of Resource.is_valid() won't -- in case of errors --
    raise an exception, but will return False. Changed the test to check for
    that.

Notes about the changes:

* `tastypie.authentication.Authentication.get_authorization_data` change

    This is about re-raising the ValueError with a custom message in case of
    .split() returning one item (instead of two). Made it explicit.

* `tastypie.resources.BaseModelResource.obj_update` change

    I left this as is, because pinpointing **all the possible exceptions** that
    may be raised during data hydration is error-prone. "# flake8: noqa"
    prevents flake8 error.

* `tests.core.tests.resources.ResourceTestCase.test_auth_check` change

    BasicResource.is_authenticated() (without a custom authentication defined
    in "meta") can only raise ImmediateHttpResponse exception. Catch it
    explicitly.

* `tests.core.tests.resources.ModelResourceTestCase.test_is_valid` change

    Current implementation of Resource.is_valid() won't -- in case of errors --
    raise an exception, but will return False. Changed the test to check for
    that.
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage decreased (-0.009%) to 95.01% when pulling e900299 on pawelswiecki:issue_1540 into d6d26ea on django-tastypie:master.

@georgedorn georgedorn merged commit 0354035 into django-tastypie:master Feb 5, 2018
1 of 2 checks passed
1 of 2 checks passed
coverage/coveralls Coverage decreased (-0.009%) to 95.01%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@georgedorn

This comment has been minimized.

Copy link
Contributor

georgedorn commented Feb 5, 2018

Coverage change must be a rounding error. Thanks for flake8 fixes.

saedmansour added a commit to segmanta/django-tastypie that referenced this pull request Dec 19, 2019
…astypie#1541)

Notes about the changes:

* `tastypie.authentication.Authentication.get_authorization_data` change

    This is about re-raising the ValueError with a custom message in case of
    .split() returning one item (instead of two). Made it explicit.

* `tastypie.resources.BaseModelResource.obj_update` change

    I left this as is, because pinpointing **all the possible exceptions** that
    may be raised during data hydration is error-prone. "# flake8: noqa"
    prevents flake8 error.

* `tests.core.tests.resources.ResourceTestCase.test_auth_check` change

    BasicResource.is_authenticated() (without a custom authentication defined
    in "meta") can only raise ImmediateHttpResponse exception. Catch it
    explicitly.

* `tests.core.tests.resources.ModelResourceTestCase.test_is_valid` change

    Current implementation of Resource.is_valid() won't -- in case of errors --
    raise an exception, but will return False. Changed the test to check for
    that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.