mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	Have testNestedInsert use an editable layer, making it idempotent
Also have it commit changes to avoid leaving cursors open
This commit is contained in:
		
							parent
							
								
									a3360965f6
								
							
						
					
					
						commit
						51d728b2bf
					
				@ -1146,13 +1146,15 @@ class TestPyQgsPostgresProvider(unittest.TestCase, ProviderTestCase):
 | 
			
		||||
 | 
			
		||||
    def testNestedInsert(self):
 | 
			
		||||
        tg = QgsTransactionGroup()
 | 
			
		||||
        tg.addLayer(self.vl)
 | 
			
		||||
        self.vl.startEditing()
 | 
			
		||||
        it = self.vl.getFeatures()
 | 
			
		||||
        l = self.getEditableLayer()
 | 
			
		||||
        tg.addLayer(l)
 | 
			
		||||
        l.startEditing()
 | 
			
		||||
        it = l.getFeatures()
 | 
			
		||||
        f = next(it)
 | 
			
		||||
        f['pk'] = NULL
 | 
			
		||||
        self.vl.addFeature(f)  # Should not deadlock during an active iteration
 | 
			
		||||
        self.assertTrue(l.addFeature(f))  # Should not deadlock during an active iteration
 | 
			
		||||
        f = next(it)
 | 
			
		||||
        l.commitChanges()
 | 
			
		||||
 | 
			
		||||
    def testTimeout(self):
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user