浏览代码

#185 Unit tests for button to read all

Alexis CLEMENT 8 年前
父节点
当前提交
14127057f6
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      tracim/tracim/tests/library/test_content_api.py

+ 9 - 6
tracim/tracim/tests/library/test_content_api.py 查看文件

@@ -364,15 +364,18 @@ class TestContentApi(BaseTest, TestStandard):
364 364
         contapiA = ContentApi(userA)
365 365
         contapiB = ContentApi(userB)
366 366
 
367
-        page = contapiA.create(ContentType.page, workspace, "this is a page")
367
+        page1 = contapiA.create(ContentType.page, workspace, "this is a page")
368
+        page2 = contapiA.create(ContentType.page, workspace, "this is another page")
368 369
 
369
-        eq_(page.revisions[-1].read_by[userB], False)
370
+        eq_(page1.revisions[-1].read_by[userB], False)
371
+        eq_(page2.revisions[-1].read_by[userB], False)
370 372
 
371
-        contapiB.mark_read(page)
373
+        itemset = contapiB.get_last_unread(None, ContentType.Any, None)
374
+        for item in itemset:
375
+            contapiB.mark_read(item)
372 376
 
373
-        eq_(page.revisions[-1].read_by[userB], True)
374
-
375
-        print("test_mark_as_read")
377
+        eq_(page1.revisions[-1].read_by[userB], True)
378
+        eq_(page2.revisions[-1].read_by[userB], True)
376 379
 
377 380
 
378 381