def test_getLowestRcvr(self): # test the simplest case of one sess w/ one rcvr sc = SourceConflicts() lr = sc.getLowestRcvr(self.proposal) r = self.session.receivers.all()[0] self.assertEqual(r, lr) # now add another sess w/ more then one rcvr s = self.createSession(self.proposal) s.receivers.add(Receiver.objects.get(abbreviation = 'Q')) s.receivers.add(Receiver.objects.get(abbreviation = '800')) s.save() lr = sc.getLowestRcvr(self.proposal) self.assertEqual('800', lr.abbreviation)