@@ -87,7 +87,8 @@ def test_view_list(self):
8787
8888 # with list
8989 clist = CommunityList .objects .create (user = User .objects .get (username = "plain" ))
90- clist .added_docs .add (draft )
90+ if not draft in clist .added_docs .all ():
91+ clist .added_docs .add (draft )
9192 SearchRule .objects .create (
9293 community_list = clist ,
9394 rule_type = "name_contains" ,
@@ -249,7 +250,8 @@ def test_csv(self):
249250
250251 # with list
251252 clist = CommunityList .objects .create (user = User .objects .get (username = "plain" ))
252- clist .added_docs .add (draft )
253+ if not draft in clist .added_docs .all ():
254+ clist .added_docs .add (draft )
253255 SearchRule .objects .create (
254256 community_list = clist ,
255257 rule_type = "name_contains" ,
@@ -284,7 +286,8 @@ def test_feed(self):
284286
285287 # with list
286288 clist = CommunityList .objects .create (user = User .objects .get (username = "plain" ))
287- clist .added_docs .add (draft )
289+ if not draft in clist .added_docs .all ():
290+ clist .added_docs .add (draft )
288291 SearchRule .objects .create (
289292 community_list = clist ,
290293 rule_type = "name_contains" ,
@@ -325,7 +328,8 @@ def test_subscription(self):
325328
326329 # subscription with list
327330 clist = CommunityList .objects .create (user = User .objects .get (username = "plain" ))
328- clist .added_docs .add (draft )
331+ if not draft in clist .added_docs .all ():
332+ clist .added_docs .add (draft )
329333 SearchRule .objects .create (
330334 community_list = clist ,
331335 rule_type = "name_contains" ,
@@ -368,7 +372,8 @@ def test_notification(self):
368372 draft = WgDraftFactory ()
369373
370374 clist = CommunityList .objects .create (user = User .objects .get (username = "plain" ))
371- clist .added_docs .add (draft )
375+ if not draft in clist .added_docs .all ():
376+ clist .added_docs .add (draft )
372377
373378 EmailSubscription .objects .create (community_list = clist , email = Email .objects .filter (person__user__username = "plain" ).first (), notify_on = "significant" )
374379
0 commit comments