mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863)
This commit is contained in:
parent
18ba1ff6a4
commit
b19f455339
6 changed files with 33 additions and 6 deletions
|
|
@ -652,6 +652,7 @@ class ThreadTests(unittest.TestCase):
|
|||
lambda: self.con.rollback(),
|
||||
lambda: self.con.close(),
|
||||
lambda: self.con.set_trace_callback(None),
|
||||
lambda: self.con.set_authorizer(None),
|
||||
lambda: self.con.create_collation("foo", None),
|
||||
]
|
||||
for fn in fns:
|
||||
|
|
|
|||
|
|
@ -522,6 +522,12 @@ class AuthorizerTests(unittest.TestCase):
|
|||
self.con.execute("select c2 from t1")
|
||||
self.assertIn('prohibited', str(cm.exception))
|
||||
|
||||
def test_clear_authorizer(self):
|
||||
self.con.set_authorizer(None)
|
||||
self.con.execute("select * from t2")
|
||||
self.con.execute("select c2 from t1")
|
||||
|
||||
|
||||
class AuthorizerRaiseExceptionTests(AuthorizerTests):
|
||||
@staticmethod
|
||||
def authorizer_cb(action, arg1, arg2, dbname, source):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue