Ejemplo n.º 1
0
    def test_committee_mails(self):
        organizer_group: OnlineGroup = G(OnlineGroup, email="*****@*****.**")

        feedback_relation = self.create_feedback_relation(
            organizer=organizer_group.group)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, organizer_group.email)

        # Default
        feedback_relation = self.create_feedback_relation()
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.DEFAULT_FROM_EMAIL)

        # Not existing
        feedback_relation = self.create_void_feedback_relation()
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, "missing mail")
Ejemplo n.º 2
0
 def test_group_email(self):
     # Feedback email should be be to the organizing committee
     organizer_group: Group = G(Group)
     online_group: OnlineGroup = G(OnlineGroup,
                                   group=organizer_group,
                                   email='*****@*****.**')
     feedback_relation = self.create_feedback_relation(
         event_type=1, organizer=organizer_group)
     email = FeedbackMail.get_committee_email(feedback_relation)
     self.assertEqual(email, online_group.email)
     self.assertNotEqual(email, settings.EMAIL_ARRKOM)
Ejemplo n.º 3
0
    def test_committee_mails(self):
        # Sosialt
        feedback_relation = self.create_feedback_relation(event_type=1)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.EMAIL_ARRKOM)

        # Bedkom
        feedback_relation = self.create_feedback_relation(
        )  # Default param is event_type=2
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.EMAIL_BEDKOM)

        # Kurs
        feedback_relation = self.create_feedback_relation(event_type=3)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.EMAIL_FAGKOM)

        # Utflukt
        feedback_relation = self.create_feedback_relation(event_type=4)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.EMAIL_ARRKOM)

        # Ekskursjon
        feedback_relation = self.create_feedback_relation(event_type=5)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.EMAIL_EKSKOM)

        # Default
        feedback_relation = self.create_feedback_relation(event_type=6)
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, settings.DEFAULT_FROM_EMAIL)

        # Not existing
        feedback_relation = self.create_void_feedback_relation()
        email = FeedbackMail.get_committee_email(feedback_relation)
        self.assertEqual(email, "missing mail")