Bläddra i källkod

#185 Unit tests for button to read all

Alexis CLEMENT 8 år sedan
förälder
incheckning
14127057f6
1 ändrade filer med 9 tillägg och 6 borttagningar
  1. 9 6
      tracim/tracim/tests/library/test_content_api.py

+ 9 - 6
tracim/tracim/tests/library/test_content_api.py Visa fil

364
         contapiA = ContentApi(userA)
364
         contapiA = ContentApi(userA)
365
         contapiB = ContentApi(userB)
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