File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,27 @@ def test_external_key_vault_2(self):
609609        self ._test_external_key_vault (False )
610610
611611
612+ class  TestViews (EncryptionIntegrationTest ):
613+ 
614+     @staticmethod  
615+     def  kms_providers ():
616+         return  {'local' : {'key' : LOCAL_MASTER_KEY }}
617+ 
618+     def  test_views_are_prohibited (self ):
619+         self .client .db .view .drop ()
620+         self .client .db .create_collection ('view' , viewOn = 'coll' )
621+         self .addCleanup (self .client .db .view .drop )
622+ 
623+         opts  =  AutoEncryptionOpts (self .kms_providers (), 'admin.datakeys' )
624+         client_encrypted  =  rs_or_single_client (
625+             auto_encryption_opts = opts , uuidRepresentation = 'standard' )
626+         self .addCleanup (client_encrypted .close )
627+ 
628+         with  self .assertRaisesRegex (
629+                 EncryptionError , 'cannot auto encrypt a view' ):
630+             client_encrypted .db .view .insert_one ({})
631+ 
632+ 
612633class  TestCorpus (EncryptionIntegrationTest ):
613634
614635    @classmethod  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments