-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sunset node settings tests for box
- Loading branch information
John Tordoff
committed
May 7, 2024
1 parent
74aeeab
commit e4c589f
Showing
6 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Views tests for the Box addon.""" | ||
from nose.tools import * # noqa (PEP8 asserts) | ||
import mock | ||
import pytest | ||
|
||
from tests.base import OsfTestCase | ||
from addons.base.tests import views as views_testing | ||
|
||
from addons.box.tests.utils import ( | ||
BoxAddonTestCase, | ||
MockBox, | ||
) | ||
from waffle.testutils import override_flag | ||
from osf import features | ||
|
||
mock_client = MockBox() | ||
|
||
|
||
@pytest.mark.django_db | ||
class TestSunsetBoxNodeSettings(BoxAddonTestCase, views_testing.OAuthAddonAuthViewsTestCaseMixin, OsfTestCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.mock_refresh = mock.patch('addons.box.models.Provider.refresh_oauth_key') | ||
self.mock_refresh.return_value = True | ||
self.mock_refresh.start() | ||
|
||
def tearDown(self): | ||
super().tearDown() | ||
self.mock_refresh.stop() | ||
|
||
@mock.patch( | ||
'addons.box.models.UserSettings.revoke_remote_oauth_access', | ||
mock.PropertyMock() | ||
) | ||
def test_node_settings(self): | ||
with override_flag(features.ENABLE_GV, active=True): | ||
super().run() |
This file contains 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 file contains 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 file contains 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