-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prove the checks work. Document test requirements.
- Loading branch information
Showing
4 changed files
with
69 additions
and
13 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
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,20 @@ | ||
from django.core.management import call_command | ||
from django.core.management.base import SystemCheckError | ||
from django.test import override_settings | ||
|
||
from .common_testing import OAuth2ProviderTestCase as TestCase | ||
|
||
|
||
class DjangoChecksTestCase(TestCase): | ||
def test_checks_pass(self): | ||
call_command("check") | ||
|
||
# CrossDatabaseRouter claims AccessToken is in beta while everything else is in alpha. | ||
# This will cause the database checks to fail. | ||
@override_settings( | ||
DATABASE_ROUTERS=["tests.db_router.CrossDatabaseRouter", "tests.db_router.AlphaRouter"] | ||
) | ||
def test_checks_fail_when_router_crosses_databases(self): | ||
message = "The token models are expected to be stored in the same database." | ||
with self.assertRaisesMessage(SystemCheckError, message): | ||
call_command("check") |