forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for BaseDatabaseIntrospection's stub methods.
- Loading branch information
Showing
1 changed file
with
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from django.db import connection | ||
from django.db.backends.base.introspection import BaseDatabaseIntrospection | ||
from django.test import SimpleTestCase | ||
|
||
|
||
class SimpleDatabaseIntrospectionTests(SimpleTestCase): | ||
may_require_msg = ( | ||
'subclasses of BaseDatabaseIntrospection may require a %s() method' | ||
) | ||
|
||
def setUp(self): | ||
self.introspection = BaseDatabaseIntrospection(connection=connection) | ||
|
||
def test_get_table_list(self): | ||
msg = self.may_require_msg % 'get_table_list' | ||
with self.assertRaisesMessage(NotImplementedError, msg): | ||
self.introspection.get_table_list(None) | ||
|
||
def test_get_sequences(self): | ||
msg = self.may_require_msg % 'get_sequences' | ||
with self.assertRaisesMessage(NotImplementedError, msg): | ||
self.introspection.get_sequences(None, None) | ||
|
||
def test_get_key_columns(self): | ||
msg = self.may_require_msg % 'get_key_columns' | ||
with self.assertRaisesMessage(NotImplementedError, msg): | ||
self.introspection.get_key_columns(None, None) | ||
|
||
def test_get_constraints(self): | ||
msg = self.may_require_msg % 'get_constraints' | ||
with self.assertRaisesMessage(NotImplementedError, msg): | ||
self.introspection.get_constraints(None, None) |