'Concurrent deletes don\'t collide and lock the database (#9479).'

def test_concurrent_delete(self):

    with transaction.atomic():
        Book.objects.create(id=1, pagecount=100)
        Book.objects.create(id=2, pagecount=200)
        Book.objects.create(id=3, pagecount=300)
    with transaction.atomic():
        self.assertEqual(3, Book.objects.count())
        with self.conn2.cursor() as cursor2:
            cursor2.execute('DELETE    from    delete_regress_book    WHERE    id    =    1')
        self.conn2.commit()
        Book.objects.filter(pagecount__lt=250).delete()
    self.assertEqual(1, Book.objects.count())
