-
-
Notifications
You must be signed in to change notification settings - Fork 7k
tests: fix usage of transaction.non_atomic_requests #6043
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This currently fails with Django 2.1 (beta), and it looks like the decorator should be used just as is in general?! NonAtomicDBTransactionAPIExceptionTests.test_api_exception_rollback_transaction_non_atomic_view: ../django/django/db/transaction.py:277: in _non_atomic_requests view._non_atomic_requests.add(using) E AttributeError: 'function' object has no attribute '_non_atomic_requests' During handling of the above exception, another exception occurred: tests/test_atomic_requests.py:149: in test_api_exception_rollback_transaction_non_atomic_view response = self.client.get('/') ../django/django/test/client.py:527: in get response = super().get(path, data=data, secure=secure, **extra) ../django/django/test/client.py:339: in get **extra, ../django/django/test/client.py:414: in generic return self.request(**r) ../django/django/test/client.py:477: in request response = self.handler(environ) ../django/django/test/client.py:140: in __call__ response = self.get_response(request) ../django/django/core/handlers/base.py:81: in get_response response = self._middleware_chain(request) ../django/django/core/handlers/exception.py:37: in inner response = response_for_exception(request, exc) ../django/django/core/handlers/exception.py:87: in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) ../django/django/core/handlers/exception.py:35: in inner response = get_response(request) ../django/django/utils/deprecation.py:91: in __call__ response = response or self.get_response(request) ../django/django/core/handlers/exception.py:37: in inner response = response_for_exception(request, exc) ../django/django/core/handlers/exception.py:87: in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) ../django/django/core/handlers/exception.py:35: in inner response = get_response(request) ../django/django/utils/deprecation.py:91: in __call__ response = response or self.get_response(request) ../django/django/core/handlers/exception.py:37: in inner response = response_for_exception(request, exc) ../django/django/core/handlers/exception.py:87: in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) ../django/django/core/handlers/exception.py:35: in inner response = get_response(request) ../django/django/utils/deprecation.py:91: in __call__ response = response or self.get_response(request) ../django/django/core/handlers/exception.py:37: in inner response = response_for_exception(request, exc) ../django/django/core/handlers/exception.py:87: in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) ../django/django/core/handlers/exception.py:35: in inner response = get_response(request) ../django/django/utils/deprecation.py:91: in __call__ response = response or self.get_response(request) ../django/django/core/handlers/exception.py:37: in inner response = response_for_exception(request, exc) ../django/django/core/handlers/exception.py:87: in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) ../django/django/core/handlers/exception.py:35: in inner response = get_response(request) ../django/django/core/handlers/base.py:128: in _get_response response = self.process_exception_by_middleware(e, request) ../django/django/core/handlers/base.py:126: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ../django/django/views/decorators/csrf.py:54: in wrapped_view return view_func(*args, **kwargs) ../django/django/views/generic/base.py:68: in view return self.dispatch(request, *args, **kwargs) ../django/django/utils/decorators.py:42: in _wrapper bound_method = dec(bound_method) ../django/django/db/transaction.py:285: in non_atomic_requests return _non_atomic_requests(using, DEFAULT_DB_ALIAS) ../django/django/db/transaction.py:279: in _non_atomic_requests view._non_atomic_requests = {using} E AttributeError: 'method' object has no attribute '_non_atomic_requests'
Merged
Coverage says its fine. https://codecov.io/gh/encode/django-rest-framework/pull/6043 Would be nice to have Codecov status integration btw. |
FYI, the Django issue that caused this report should be fixed in the next release: |
@cjerdonek |
pchiquet
pushed a commit
to pchiquet/django-rest-framework
that referenced
this pull request
Nov 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This currently fails with Django 2.1 (beta), and it looks like the
decorator should be used just as is in general?!
Initially added in c292b3d by @hellysmile.