MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_views_are_prohibited

Method test_views_are_prohibited

test/test_encryption.py:860–871  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

858 return {"local": {"key": LOCAL_MASTER_KEY}}
859
860 def test_views_are_prohibited(self):
861 self.client.db.view.drop()
862 self.client.db.create_collection("view", viewOn="coll")
863 self.addCleanup(self.client.db.view.drop)
864
865 opts = AutoEncryptionOpts(self.kms_providers(), "keyvault.datakeys")
866 client_encrypted = self.rs_or_single_client(
867 auto_encryption_opts=opts, uuidRepresentation="standard"
868 )
869
870 with self.assertRaisesRegex(EncryptionError, "cannot auto encrypt a view"):
871 client_encrypted.db.view.insert_one({})
872
873
874class TestCorpus(EncryptionIntegrationTest):

Callers

nothing calls this directly

Calls 7

kms_providersMethod · 0.95
AutoEncryptionOptsClass · 0.90
addCleanupMethod · 0.80
rs_or_single_clientMethod · 0.80
dropMethod · 0.45
create_collectionMethod · 0.45
insert_oneMethod · 0.45

Tested by

no test coverage detected