@@ -1071,7 +1071,7 @@ def test_feedback_closed(self):
10711071 self .assertTrue ( q ('#nominees a' ) )
10721072 self .assertFalse ( q ('#nominees a[href]' ) )
10731073
1074- url += "?nominee=%d&position=%d" % (self .nc .nominee_set .first ().id , self .nc .nominee_set .first ().nomineeposition_set .first ().position .id )
1074+ url += "?nominee=%d&position=%d" % (self .nc .nominee_set .order_by ( 'pk' ). first ().id , self .nc .nominee_set .order_by ( 'pk' ). first ().nomineeposition_set . order_by ( 'pk' ) .first ().position .id )
10751075 response = self .client .get (url )
10761076 self .assertEqual (response .status_code , 200 )
10771077 q = PyQuery (response .content )
@@ -1102,7 +1102,7 @@ def test_nominations_closed(self):
11021102
11031103 def test_acceptance_closed (self ):
11041104 today = datetime .date .today ().strftime ('%Y%m%d' )
1105- pid = self .nc .position_set .first ().nomineeposition_set .first ().id
1105+ pid = self .nc .position_set .first ().nomineeposition_set .order_by ( 'pk' ). first ().id
11061106 url = reverse ('ietf.nomcom.views.process_nomination_status' , kwargs = {
11071107 'year' : self .nc .year (),
11081108 'nominee_position_id' : pid ,
@@ -1247,7 +1247,7 @@ def setUp(self):
12471247 self .nc = NomComFactory .create (** nomcom_kwargs_for_year ())
12481248 self .author = PersonFactory .create ().email_set .first ().address
12491249 self .member = self .nc .group .role_set .filter (name = 'member' ).first ().person
1250- self .nominee = self .nc .nominee_set .first ()
1250+ self .nominee = self .nc .nominee_set .order_by ( 'pk' ). first ()
12511251 self .position = self .nc .position_set .first ()
12521252 for type_id in ['comment' ,'nomina' ,'questio' ]:
12531253 f = FeedbackFactory .create (author = self .author ,nomcom = self .nc ,type_id = type_id )
@@ -1360,7 +1360,7 @@ def test_accept_reject_nomination_edges(self):
13601360 self .assertTrue ('Bad hash!' in unicontent (response ))
13611361
13621362 def test_accept_reject_nomination_comment (self ):
1363- np = self .nc .nominee_set .first ().nomineeposition_set .first ()
1363+ np = self .nc .nominee_set .order_by ( 'pk' ). first ().nomineeposition_set . order_by ( 'pk' ) .first ()
13641364 hash = get_hash_nominee_position (np .time .strftime ("%Y%m%d" ),np .id )
13651365 url = reverse ('ietf.nomcom.views.process_nomination_status' ,
13661366 kwargs = {'year' :self .nc .year (),
@@ -1452,7 +1452,7 @@ def test_simple_feedback_pending(self):
14521452 self .assertEqual (np .nominee .feedback_set .count (),fb_count_before + 1 )
14531453
14541454 fb = FeedbackFactory (nomcom = self .nc ,type_id = None )
1455- nominee = self .nc .nominee_set .first ()
1455+ nominee = self .nc .nominee_set .order_by ( 'pk' ). first ()
14561456 position = self .nc .position_set .exclude (nomineeposition__nominee = nominee ).first ()
14571457 self .assertIsNotNone (position )
14581458 fb_count_before = nominee .feedback_set .count ()
@@ -1538,7 +1538,7 @@ def test_complicated_feedback_pending(self):
15381538 fb0 = FeedbackFactory (nomcom = self .nc ,type_id = None )
15391539 fb1 = FeedbackFactory (nomcom = self .nc ,type_id = None )
15401540 fb2 = FeedbackFactory (nomcom = self .nc ,type_id = None )
1541- nominee = self .nc .nominee_set .first ()
1541+ nominee = self .nc .nominee_set .order_by ( 'pk' ). first ()
15421542 new_position_for_nominee = self .nc .position_set .exclude (nomineeposition__nominee = nominee ).first ()
15431543
15441544 # Initial formset
0 commit comments