From 5b8cc00964f53910a904ab8f429b3533dbb1fdf8 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 26 Jan 2022 19:48:55 +0500 Subject: [PATCH] test: Fixed test failures due to randomization. (#29822) * test: Fixed test failures due to randomization. --- .../core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py index 8992139df5..ef30e6d341 100644 --- a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py +++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py @@ -9,6 +9,7 @@ import pytest import ddt from django.conf import settings from django.test import TestCase +from django.urls import reverse from django.utils.timezone import now from oauth2_provider import models @@ -106,6 +107,10 @@ class DOTAdapterTestCase(TestCase): Make sure when generating an access_token for a restricted client that the token is immediately expired """ + + # for this test it requires to call AccessTokenView(_DispatchingView) otherwise it fails + # to set the expiry. + self.client.post(reverse('access_token'), {}) self.adapter.create_access_token_for_test( 'expired-token-id', client=self.restricted_client,