Guénaël Muller 6 år sedan
förälder
incheckning
4b9a0d972a
1 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 2
      tracim/tracim/tests/library/test_webdav.py

+ 7 - 2
tracim/tracim/tests/library/test_webdav.py Visa fil

@@ -339,9 +339,14 @@ class TestWebDav(TestStandard):
339 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 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 350
         eq_(
346 351
             False,
347 352
             content_new_file.is_deleted,