@@ -680,18 +680,18 @@ def test_get_siblings(self):
680680 d = self .__get_cat (name = "d" )
681681 e = self .__get_cat (name = "e" )
682682 f = self .__get_cat (name = "f" )
683- self .assertEqual (a .tn_siblings_pks , join_pks ([b . pk , c . pk , d . pk , e . pk , f . pk ]))
684- self .assertEqual (b .tn_siblings_pks , join_pks ([a . pk , c . pk , d . pk , e . pk , f . pk ]))
685- self .assertEqual (c .tn_siblings_pks , join_pks ([a . pk , b . pk , d . pk , e . pk , f . pk ]))
686- self .assertEqual (d .tn_siblings_pks , join_pks ([a . pk , b . pk , c . pk , e . pk , f . pk ]))
687- self .assertEqual (e .tn_siblings_pks , join_pks ([a . pk , b . pk , c . pk , d . pk , f . pk ]))
688- self .assertEqual (f .tn_siblings_pks , join_pks ([a . pk , b . pk , c . pk , d . pk , e . pk ]))
689- self .assertEqual (a .get_siblings (), [b , c , d , e , f ])
690- self .assertEqual (b .get_siblings (), [a , c , d , e , f ])
691- self .assertEqual (c .get_siblings (), [a , b , d , e , f ])
692- self .assertEqual (d .get_siblings (), [a , b , c , e , f ])
693- self .assertEqual (e .get_siblings (), [a , b , c , d , f ])
694- self .assertEqual (f .get_siblings (), [a , b , c , d , e ])
683+ self .assertEqual (a .tn_siblings_pks , join_pks ([]))
684+ self .assertEqual (b .tn_siblings_pks , join_pks ([]))
685+ self .assertEqual (c .tn_siblings_pks , join_pks ([]))
686+ self .assertEqual (d .tn_siblings_pks , join_pks ([]))
687+ self .assertEqual (e .tn_siblings_pks , join_pks ([]))
688+ self .assertEqual (f .tn_siblings_pks , join_pks ([]))
689+ self .assertEqual (a .get_siblings (), [])
690+ self .assertEqual (b .get_siblings (), [])
691+ self .assertEqual (c .get_siblings (), [])
692+ self .assertEqual (d .get_siblings (), [])
693+ self .assertEqual (e .get_siblings (), [])
694+ self .assertEqual (f .get_siblings (), [])
695695 aa = self .__get_cat (name = "aa" )
696696 ab = self .__get_cat (name = "ab" )
697697 ac = self .__get_cat (name = "ac" )
@@ -731,12 +731,12 @@ def test_get_siblings_count(self):
731731 d = self .__get_cat (name = "d" )
732732 e = self .__get_cat (name = "e" )
733733 f = self .__get_cat (name = "f" )
734- self .assertEqual (a .get_siblings_count (), 5 )
735- self .assertEqual (b .get_siblings_count (), 5 )
736- self .assertEqual (c .get_siblings_count (), 5 )
737- self .assertEqual (d .get_siblings_count (), 5 )
738- self .assertEqual (e .get_siblings_count (), 5 )
739- self .assertEqual (f .get_siblings_count (), 5 )
734+ self .assertEqual (a .get_siblings_count (), 0 )
735+ self .assertEqual (b .get_siblings_count (), 0 )
736+ self .assertEqual (c .get_siblings_count (), 0 )
737+ self .assertEqual (d .get_siblings_count (), 0 )
738+ self .assertEqual (e .get_siblings_count (), 0 )
739+ self .assertEqual (f .get_siblings_count (), 0 )
740740 aa = self .__get_cat (name = "aa" )
741741 ab = self .__get_cat (name = "ab" )
742742 ac = self .__get_cat (name = "ac" )
@@ -1003,7 +1003,7 @@ def test_is_last_child(self):
10031003 self .assertFalse (c .is_last_child ())
10041004 self .assertFalse (d .is_last_child ())
10051005 self .assertFalse (e .is_last_child ())
1006- self .assertTrue (f .is_last_child ())
1006+ self .assertFalse (f .is_last_child ())
10071007 aa = self .__get_cat (name = "aa" )
10081008 ab = self .__get_cat (name = "ab" )
10091009 ac = self .__get_cat (name = "ac" )
@@ -1204,7 +1204,7 @@ def test_num_queries(self):
12041204 with self .assertNumQueries (1 ):
12051205 clear_cache (self ._category_model )
12061206 a .get_siblings ()
1207- with self .assertNumQueries (1 ):
1207+ with self .assertNumQueries (0 ):
12081208 a .get_siblings (cache = False )
12091209 with self .assertNumQueries (0 ):
12101210 a .get_siblings_count ()
@@ -1296,7 +1296,7 @@ def test_update_on_create(self):
12961296 c = self .__create_cat (name = "c" )
12971297 self .assertEqual (a .tn_children_pks , "" )
12981298 self .assertEqual (a .tn_ancestors_pks , "" )
1299- self .assertEqual (a .tn_siblings_pks , join_pks ([b . pk , c . pk ]))
1299+ self .assertEqual (a .tn_siblings_pks , join_pks ([]))
13001300 aa = self .__create_cat (name = "aa" , parent = a )
13011301 ab = self .__create_cat (name = "ab" , parent = a )
13021302 ac = self .__create_cat (name = "ac" , parent = a )
@@ -1354,7 +1354,7 @@ def test_update_on_delete(self):
13541354 c = self .__get_cat (name = "c" )
13551355 d = self .__get_cat (name = "d" )
13561356 self .assertTrue (d .is_first_child ())
1357- self .assertEqual (d .get_siblings_count (), 2 )
1357+ self .assertEqual (d .get_siblings_count (), 0 )
13581358
13591359 def test_update_on_get (self ):
13601360 self .__create_cat (name = "a" )
0 commit comments