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

Impossible to bypass THROTTLE - Django REST #1067

Open
Pithikos opened this issue May 24, 2023 · 0 comments
Open

Impossible to bypass THROTTLE - Django REST #1067

Pithikos opened this issue May 24, 2023 · 0 comments

Comments

@Pithikos
Copy link

Pithikos commented May 24, 2023

I'm trying to test throttling in some test cases with live_server and it's a pain in the butt.

After spending way too much time trying to override LiveServer I figured it might be simpler to just disable throttling for most test cases with an autouse fixture like below.

@pytest.fixture(autouse=True)
def bypass_throttle(settings):
    settings.REST_FRAMEWORK["DEFAULT_THROTTLE_CLASSES"] = []
    settings.REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = {}
    yield

However this again has no effect. Is there any reliable way to do this?

@Pithikos Pithikos changed the title Impossible to bypass THROTTLE Impossible to bypass THROTTLE - Django REST May 24, 2023
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

No branches or pull requests

1 participant