More tests for revisions-api. Fix minor bugs.

This commit is contained in:
Felipe Monteiro
2017-07-29 21:24:53 +01:00
parent a0df0c459d
commit adca9575b6
6 changed files with 172 additions and 67 deletions

View File

@@ -122,8 +122,13 @@ def document_create(values, session=None):
session = session or get_session()
filters = models.Document.UNIQUE_CONSTRAINTS
existing_document = document_get(**{c: values[c] for c in filters
if c != 'revision_id'})
try:
existing_document = document_get(**{c: values[c] for c in filters
if c != 'revision_id'})
except db_exception.DBError:
# Ignore bad data at this point. Allow creation to bubble up the error
# related to bad data.
existing_document = None
created_document = {}