def test_forum_update_read_two_topics(database, user, topic, topic_moderator):
 forumsread = ForumsRead.query.filter((ForumsRead.user_id == user.id), (ForumsRead.forum_id == topic.forum_id)).first()
 forum = topic.forum
 with current_app.test_request_context():
  login_user(user)
  topicsread = TopicsRead()
  topicsread.user_id = user.id
  topicsread.topic_id = topic.id
  topicsread.forum_id = topic.forum_id
  topicsread.last_read = datetime.utcnow()
  topicsread.save()
  assert (not forum.update_read(current_user, forumsread, topicsread))

def test_forum_update_read_two_topics ( database , user , topic , topic_moderator ) : forumsread = ForumsRead . query . filter ( ( ForumsRead . user_id == user . id ) , ( ForumsRead . forum_id == topic . forum_id ) ) . first ( ) forum = topic . forum with current_app . test_request_context ( ) : login_user ( user ) topicsread = TopicsRead ( ) topicsread . user_id = user . id topicsread . topic_id = topic . id topicsread . forum_id = topic . forum_id topicsread . last_read = datetime . utcnow ( ) topicsread . save ( ) assert ( not forum . update_read ( current_user , forumsread , topicsread ) )
test if the forumsread tracker will be updated if there are two topics and where one is unread and the other is read .