Esempio n. 1
0
    def setUp(self):
        nomcom_test_data()
        self.cert_file, self.privatekey_file = generate_cert()
        self.year = NOMCOM_YEAR

        # private urls
        self.private_index_url = reverse('nomcom_private_index',
                                         kwargs={'year': self.year})
        self.private_merge_url = reverse('nomcom_private_merge',
                                         kwargs={'year': self.year})
        self.edit_members_url = reverse('nomcom_edit_members',
                                        kwargs={'year': self.year})
        self.edit_chair_url = reverse('nomcom_edit_chair',
                                      kwargs={'year': self.year})
        self.edit_nomcom_url = reverse('nomcom_edit_nomcom',
                                       kwargs={'year': self.year})
        self.private_nominate_url = reverse('nomcom_private_nominate',
                                            kwargs={'year': self.year})
        self.add_questionnaire_url = reverse('nomcom_private_questionnaire',
                                             kwargs={'year': self.year})
        self.private_feedback_url = reverse('nomcom_private_feedback',
                                            kwargs={'year': self.year})

        # public urls
        self.index_url = reverse('nomcom_year_index',
                                 kwargs={'year': self.year})
        self.requirements_url = reverse('nomcom_requirements',
                                        kwargs={'year': self.year})
        self.questionnaires_url = reverse('nomcom_questionnaires',
                                          kwargs={'year': self.year})
        self.public_feedback_url = reverse('nomcom_public_feedback',
                                           kwargs={'year': self.year})
        self.public_nominate_url = reverse('nomcom_public_nominate',
                                           kwargs={'year': self.year})
Esempio n. 2
0
File: tests.py Progetto: ekr/ietfdb
 def test_valid_submit(self):
     "Valid Submit"
     make_test_data()
     nomcom_test_data()
     empty_outbox()
     url = reverse('ietf.secr.announcement.views.main')
     confirm_url = reverse('ietf.secr.announcement.views.confirm')
     nomcom = Group.objects.get(type='nomcom')
     post_data = {
         'nomcom': nomcom.pk,
         'to': 'Other...',
         'to_custom': '*****@*****.**',
         'frm': 'IETF Secretariat <[email protected]>',
         'subject': 'Test Subject',
         'body': 'This is a test.'
     }
     self.client.login(username="******", password="******")
     response = self.client.post(url, post_data)
     self.assertEqual(response.status_code, 200)
     self.assertTrue('Confirm Announcement' in response.content)
     response = self.client.post(confirm_url, post_data, follow=True)
     self.assertRedirects(response, url)
     self.assertEqual(len(outbox), 1)
     self.assertEqual(outbox[0]['subject'], 'Test Subject')
     self.assertEqual(outbox[0]['to'], '<*****@*****.**>')
     message = Message.objects.last()
     self.assertEqual(message.subject, 'Test Subject')
     self.assertTrue(nomcom in message.related_groups.all())
Esempio n. 3
0
 def test_merge_nominees(self):
     nomcom_test_data()
     nomcom = NomCom.objects.first()
     source = PersonFactory()
     source.nominee_set.create(nomcom=nomcom, email=source.email())
     target = PersonFactory()
     merge_nominees(source, target)
     self.assertTrue(target.nominee_set.all())
Esempio n. 4
0
    def setUp(self):
        nomcom_test_data()
        self.cert_file, self.privatekey_file = get_cert_files()
        self.year = NOMCOM_YEAR

        # private urls
        self.private_index_url = reverse('nomcom_private_index', kwargs={'year': self.year})
        self.private_merge_url = reverse('nomcom_private_merge', kwargs={'year': self.year})
        self.edit_members_url = reverse('nomcom_edit_members', kwargs={'year': self.year})
        self.edit_chair_url = reverse('nomcom_edit_chair', kwargs={'year': self.year})
        self.edit_nomcom_url = reverse('nomcom_edit_nomcom', kwargs={'year': self.year})
        self.private_nominate_url = reverse('nomcom_private_nominate', kwargs={'year': self.year})
        self.add_questionnaire_url = reverse('nomcom_private_questionnaire', kwargs={'year': self.year})
        self.private_feedback_url = reverse('nomcom_private_feedback', kwargs={'year': self.year})

        # public urls
        self.index_url = reverse('nomcom_year_index', kwargs={'year': self.year})
        self.requirements_url = reverse('nomcom_requirements', kwargs={'year': self.year})
        self.questionnaires_url = reverse('nomcom_questionnaires', kwargs={'year': self.year})
        self.public_feedback_url = reverse('nomcom_public_feedback', kwargs={'year': self.year})
        self.public_nominate_url = reverse('nomcom_public_nominate', kwargs={'year': self.year})
Esempio n. 5
0
    def setUp(self):
        nomcom_test_data()
        self.nomcom = get_nomcom_by_year(NOMCOM_YEAR)
        self.cert_file, self.privatekey_file = get_cert_files()
        self.nomcom.public_key.storage.location = tempfile.gettempdir()
        self.nomcom.public_key.save('cert', File(open(self.cert_file.name, 'r')))

        gen = Position.objects.get(nomcom=self.nomcom,name='GEN')
        rai = Position.objects.get(nomcom=self.nomcom,name='RAI')
        iab = Position.objects.get(nomcom=self.nomcom,name='IAB')

        today = datetime.date.today()
        t_minus_3 = today - datetime.timedelta(days=3)
        t_minus_4 = today - datetime.timedelta(days=4)
        n = get_or_create_nominee(self.nomcom,"Nominee 1","*****@*****.**",gen,None)
        np = n.nomineeposition_set.get(position=gen)
        np.time = t_minus_3
        np.save()
        n = get_or_create_nominee(self.nomcom,"Nominee 1","*****@*****.**",iab,None)
        np = n.nomineeposition_set.get(position=iab)
        np.state = NomineePositionState.objects.get(slug='accepted')
        np.time = t_minus_3
        np.save()
        n = get_or_create_nominee(self.nomcom,"Nominee 2","*****@*****.**",rai,None)
        np = n.nomineeposition_set.get(position=rai)
        np.time = t_minus_4
        np.save()
        n = get_or_create_nominee(self.nomcom,"Nominee 2","*****@*****.**",gen,None)
        np = n.nomineeposition_set.get(position=gen)
        np.state = NomineePositionState.objects.get(slug='accepted')
        np.time = t_minus_4
        np.save()
        feedback = Feedback.objects.create(nomcom=self.nomcom,
                                           comments='some non-empty comments',
                                           type=FeedbackType.objects.get(slug='questio'),
                                           user=User.objects.get(username=CHAIR_USER))
        feedback.positions.add(gen)
        feedback.nominees.add(n)
Esempio n. 6
0
 def setUp(self):
     nomcom_test_data()
     self.cert_file, self.privatekey_file = get_cert_files()
Esempio n. 7
0
 def setUp(self):
     nomcom_test_data()
     self.nominee = Nominee.objects.get(email__person__user__username=COMMUNITY_USER)
Esempio n. 8
0
 def setUp(self):
     nomcom_test_data()
     self.cert_file, self.privatekey_file = generate_cert()
Esempio n. 9
0
 def setUp(self):
     nomcom_test_data()
     self.nominee = Nominee.objects.get(email__person__name=COMMUNITY_USER)