-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tests * pre-commit * improve remove blacklist app * update setup for test_backends
- Loading branch information
Showing
7 changed files
with
192 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from importlib import reload | ||
from unittest.mock import Mock, patch | ||
|
||
from django.test import SimpleTestCase | ||
from pkg_resources import DistributionNotFound | ||
|
||
|
||
class TestInit(SimpleTestCase): | ||
def test_package_is_not_installed(self): | ||
with patch( | ||
"pkg_resources.get_distribution", Mock(side_effect=DistributionNotFound) | ||
): | ||
# Import package mock package is not installed | ||
import rest_framework_simplejwt.__init__ | ||
|
||
self.assertEqual(rest_framework_simplejwt.__init__.__version__, None) | ||
|
||
# Restore origin package without mock | ||
reload(rest_framework_simplejwt.__init__) |
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
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