If you have any deleted Salesforce objects, the update (and probably upsert, and potentially other CRUD operations) don't work correctly. The code that checks for the index of the object that needs to be modified does not include deleted objects, but the code that updates the object at that index does include deleted objects, so the indices are mismatched.
Specifically for update:
|
sobjects = self.get_sobjects(sobject_name) |
gets the index of the object to update, ignoring deleted objects
|
self.data[sobject_name][index] = { |
updates the object, indexing into the list of all objects (deleted and undeleted) with the index acquired from the list of undeleted objects.
Reproduction pseudo-code:
@mock_salesforce
def test():
note = self.simple_salesforce.Note.create(...)
self.simple_salesforce.Note.delete(note["id"])
note_two = self.simple_salesforce.Note.create(...)
self.simple_salesforce.Note.update(...)
# At this point, note_two is unchanged; note got the update even though it was deleted.
If you have any deleted Salesforce objects, the
update(and probablyupsert, and potentially other CRUD operations) don't work correctly. The code that checks for the index of the object that needs to be modified does not include deleted objects, but the code that updates the object at that index does include deleted objects, so the indices are mismatched.Specifically for update:
simple-mockforce/simple_mockforce/virtual.py
Line 145 in 1adc78e
simple-mockforce/simple_mockforce/virtual.py
Line 154 in 1adc78e
Reproduction pseudo-code: