@@ -59,10 +59,14 @@ def test_not_found() -> None:
5959 obj .name = "non-existing2"
6060 with pytest .raises (exceptions .ObjectNotFound ):
6161 obj .refresh ()
62+ branches .Branch .CACHE .clear ()
63+ projects .Project .CACHE .clear ()
6264
6365 obj .concerned_object .key = "non-existing2"
6466 with pytest .raises (exceptions .ObjectNotFound ):
6567 obj .new_code ()
68+ branches .Branch .CACHE .clear ()
69+ projects .Project .CACHE .clear ()
6670
6771
6872def test_is_main_is_kept ():
@@ -99,9 +103,11 @@ def test_set_as_main():
99103
100104 assert main_br .set_as_main ()
101105
102- main_br .name = "non-existing"
106+ main_br .name = "non-existing-main "
103107 with pytest .raises (exceptions .ObjectNotFound ):
104108 main_br .set_as_main ()
109+ branches .Branch .CACHE .clear ()
110+ projects .Project .CACHE .clear ()
105111
106112
107113def test_set_keep_as_inactive ():
@@ -120,9 +126,11 @@ def test_set_keep_as_inactive():
120126
121127 assert dev_br .set_keep_when_inactive (True )
122128
123- dev_br .name = "non-existing"
129+ dev_br .name = "non-existing-develop "
124130 with pytest .raises (exceptions .ObjectNotFound ):
125131 dev_br .set_keep_when_inactive (True )
132+ branches .Branch .CACHE .clear ()
133+ projects .Project .CACHE .clear ()
126134
127135
128136def test_rename ():
@@ -154,9 +162,11 @@ def test_get_findings():
154162 dev_br = branches .Branch .get_object (concerned_object = project , branch_name = "develop" )
155163 assert len (dev_br .get_findings ()) > 0
156164
157- dev_br .name = "non-existing"
165+ dev_br .name = "non-existing-dev2 "
158166 with pytest .raises (exceptions .ObjectNotFound ):
159167 dev_br .get_findings ()
168+ branches .Branch .CACHE .clear ()
169+ projects .Project .CACHE .clear ()
160170
161171
162172def test_audit ():
@@ -167,8 +177,10 @@ def test_audit():
167177 dev_br = branches .Branch .get_object (concerned_object = project , branch_name = "develop" )
168178 assert len (dev_br .audit ({"audit.project.branches" : False })) == 0
169179
170- dev_br .name = "non-existing"
180+ dev_br .name = "non-existing-dev3 "
171181 assert len (dev_br .audit ({})) == 0
182+ branches .Branch .CACHE .clear ()
183+ projects .Project .CACHE .clear ()
172184
173185
174186def test_exists ():
0 commit comments