def test_check_not_currently_matched(self):
        self.fresh_setup()
        t = Profile.objects.get(first_name='tiffany')
        a = Profile.objects.get(first_name='andrew')
        pj = Profile.objects.get(first_name='philip')
        t_av = GroupAvailability.objects.get(profile=t,
                                             time_available_utc=self.future)
        a_av = GroupAvailability.objects.get(profile=a,
                                             time_available_utc=self.future)
        pj_av = GroupAvailability.objects.get(profile=pj,
                                              time_available_utc=self.future)

        # case where users don't have any matches in the beginning
        self.assertEqual(Command.check_not_currently_matched(Command(), a_av),
                         True)
        self.assertEqual(Command.check_not_currently_matched(Command(), t_av),
                         True)
        self.assertEqual(Command.check_not_currently_matched(Command(), pj_av),
                         True)
Ejemplo n.º 2
0
    def test_check_not_currently_matched(self):
        self.fresh_setup()
        t = Profile.objects.get(first_name='tiffany')
        a = Profile.objects.get(first_name='andrew')
        pj = Profile.objects.get(first_name='philip')
        t_av = Availability.objects.get(profile=t,
                                        time_available_utc=self.future)
        a_av = Availability.objects.get(profile=a,
                                        time_available_utc=self.future)
        pj_av = Availability.objects.get(profile=pj,
                                         time_available_utc=self.future)

        # case where users don't have any matches in the beginning
        self.assertEqual(Command.check_not_currently_matched(Command(), a_av),
                         True)
        self.assertEqual(Command.check_not_currently_matched(Command(), t_av),
                         True)
        self.assertEqual(Command.check_not_currently_matched(Command(), pj_av),
                         True)

        # case where users just were matched
        t_av.matched_name = 'andrew test'
        t_av.matched_email = '*****@*****.**'
        a_av.matched_name = 'tiffany test'
        a_av.matched_email = '*****@*****.**'

        self.assertEqual(Command.check_not_currently_matched(Command(), a_av),
                         False)
        self.assertEqual(Command.check_not_currently_matched(Command(), t_av),
                         False)
        self.assertEqual(Command.check_not_currently_matched(Command(), pj_av),
                         True)