Browse Source

update test

Guénaël Muller 6 years ago
parent
commit
4b9a0d972a
1 changed files with 7 additions and 2 deletions
  1. 7 2
      tracim/tracim/tests/library/test_webdav.py

+ 7 - 2
tracim/tracim/tests/library/test_webdav.py View File

339
             new_file
339
             new_file
340
         ))
340
         ))
341
 
341
 
342
+        nb_rev = DBSession.query(ContentRevisionRO) \
343
+            .filter(Content.label == 'new_file')\
344
+            .order_by(Content.revision_id.desc()).count()
345
+        eq_(nb_rev, 2, "It must exist only be 2 revision.")
346
+
342
         content_new_file = DBSession.query(ContentRevisionRO) \
347
         content_new_file = DBSession.query(ContentRevisionRO) \
343
-            .filter(Content.label == 'new_file') \
344
-            .one()  # It must exist only one revision
348
+            .filter(Content.label == 'new_file').order_by(ContentRevisionRO.revision_id)\
349
+            .order_by(Content.revision_id.desc()).first()
345
         eq_(
350
         eq_(
346
             False,
351
             False,
347
             content_new_file.is_deleted,
352
             content_new_file.is_deleted,