#NEWLINE# def test_topic_notification_has_notifications_dont_count_topic_removed_or_no_access( self ) : #NEWLINE# #INDENT# '\n        dont show private topics if user has no access or is removed\n        ' #NEWLINE# TopicNotification . objects . all ( ) . delete ( ) #NEWLINE# category = utils . create_category ( ) #NEWLINE# category_removed = utils . create_category ( is_removed = True ) #NEWLINE# subcategory = utils . create_category ( parent = category_removed ) #NEWLINE# subcategory_removed = utils . create_category ( parent = category , is_removed = True ) #NEWLINE# topic_a = utils . create_private_topic ( ) #NEWLINE# topic_b = utils . create_topic ( category = category , is_removed = True ) #NEWLINE# topic_c = utils . create_topic ( category = category_removed ) #NEWLINE# topic_d = utils . create_topic ( category = subcategory ) #NEWLINE# topic_e = utils . create_topic ( category = subcategory_removed ) #NEWLINE# TopicNotification . objects . create ( user = self . user , topic = topic_a . topic , comment = self . comment , is_active = True , action = COMMENT ) #NEWLINE# TopicNotification . objects . create ( user = self . user , topic = topic_b , comment = self . comment , is_active = True , action = COMMENT ) #NEWLINE# TopicNotification . objects . create ( user = self . user , topic = topic_c , comment = self . comment , is_active = True , action = COMMENT ) #NEWLINE# TopicNotification . objects . create ( user = self . user , topic = topic_d , comment = self . comment , is_active = True , action = COMMENT ) #NEWLINE# TopicNotification . objects . create ( user = self . user , topic = topic_e , comment = self . comment , is_active = True , action = COMMENT ) #NEWLINE# self . assertEqual ( len ( TopicNotification . objects . filter ( user = self . user , is_active = True , is_read = False ) ) , 5 ) #NEWLINE# self . assertFalse ( has_topic_notifications ( self . user ) )