'Compare bulk.execute()[\'writeErrors\'] to expected value.
Like: {\'index\': 0, \'code\': 123, \'errmsg\': \'...\', \'op\': { ... }}'

def assertEqualWriteError(self, expected, actual):

    self.assertEqual(expected['index'], actual['index'])
    self.assertEqual(expected['code'], actual['code'])
    if (expected['errmsg'] == '...'):
        self.assertTrue(('errmsg' in actual))
    else:
        self.assertEqual(expected['errmsg'], actual['errmsg'])
    expected_op = expected['op'].copy()
    actual_op = actual['op'].copy()
    if (expected_op.get('_id') == '...'):
        self.assertTrue(('_id' in actual_op))
        actual_op.pop('_id')
        expected_op.pop('_id')
    self.assertEqual(expected_op, actual_op)
