-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent exposing Django Admin features referencing media tables in pr…
…od (#4349)
- Loading branch information
1 parent
bc457c0
commit 0dbe130
Showing
3 changed files
with
44 additions
and
6 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,21 @@ | ||
from unittest import mock | ||
|
||
import pytest | ||
|
||
from api.admin.media_report import _production_deferred | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"values, environment, expected", | ||
[ | ||
([1, 2, 3], "local", (1, 2, 3)), | ||
([1, 2, 3], "production", ()), | ||
([], "local", ()), | ||
([], "production", ()), | ||
], | ||
) | ||
def test_production_deferred(values, environment, expected): | ||
with mock.patch("api.admin.media_report.settings") as mock_settings: | ||
mock_settings.ENVIRONMENT = environment | ||
actual = _production_deferred(*values) | ||
assert actual == expected |