Skip to content

Commit

Permalink
Ajust sys tests: don't passing explicit 'exists' to update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Nov 13, 2018
1 parent a805852 commit f1dee59
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions firestore/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ def test_document_integer_field(client, cleanup):
document.create(data1)

data2 = {'1a.ab': '4d', '6f.7g': '9h'}
option2 = client.write_option(exists=True)
document.update(data2, option=option2)
document.update(data2)
snapshot = document.get()
expected = {
'1a': {
Expand Down Expand Up @@ -311,9 +310,8 @@ def test_update_document(client, cleanup):
assert document_id in exc_info.value.message

# 1. Try to update before the document exists (now with an option).
option1 = client.write_option(exists=True)
with pytest.raises(NotFound) as exc_info:
document.update({'still': 'not-there'}, option=option1)
document.update({'still': 'not-there'})
assert exc_info.value.message.startswith(MISSING_DOCUMENT)
assert document_id in exc_info.value.message

Expand All @@ -327,8 +325,7 @@ def test_update_document(client, cleanup):
},
'other': True,
}
option2 = client.write_option(exists=False)
write_result2 = document.update(data, option=option2)
write_result2 = document.create(data)

# 3. Send an update without a field path (no option).
field_updates3 = {'foo': {'quux': 800}}
Expand Down

0 comments on commit f1dee59

Please sign in to comment.