Example #1
0
    def test_programme_roles(self):
        """
        If someone has multiple programmes, they should get the job title of the highest-priority (lowest
        priority number) Role.
        """
        programme_role, unused = ProgrammeRole.get_or_create_dummy()
        role = programme_role.role
        personnel_class = role.personnel_class
        programme = programme_role.programme

        badge, created = Badge.ensure(person=self.person, event=self.event)
        assert not created
        assert badge.job_title == role.title

        programme2, unused = Programme.get_or_create_dummy(
            title='Cosplay-deitti')
        role2, unused = Role.get_or_create_dummy(
            personnel_class=personnel_class,
            priority=role.priority - 10,
            title='More Importanter Programme Person',
        )
        programme_Role2, unused = ProgrammeRole.get_or_create_dummy(
            programme=programme2, role=role2)

        programme2.apply_state()

        badge, created = Badge.ensure(person=self.person, event=self.event)
        assert not created
        assert badge.job_title == role2.title
Example #2
0
    def test_programme_roles(self):
        """
        If someone has multiple programmes, they should get the job title of the highest-priority (lowest
        priority number) Role.
        """
        programme_role, unused = ProgrammeRole.get_or_create_dummy()
        role = programme_role.role
        personnel_class = role.personnel_class
        programme = programme_role.programme

        badge, created = Badge.ensure(person=self.person, event=self.event)
        assert not created
        assert badge.job_title == role.title

        programme2, unused = Programme.get_or_create_dummy(title='Cosplay-deitti')
        role2, unused = Role.get_or_create_dummy(
            personnel_class=personnel_class,
            priority=role.priority - 10,
            title='More Importanter Programme Person',
        )
        programme_Role2, unused = ProgrammeRole.get_or_create_dummy(programme=programme2, role=role2)

        programme2.apply_state()

        badge, created = Badge.ensure(person=self.person, event=self.event)
        assert not created
        assert badge.job_title == role2.title
Example #3
0
    def test_desuprogramme_import(self):

        programme, unused = Programme.get_or_create_dummy()
        payload = dict(
            feedback="Oli ihan kakka",
            desucon_username="******",
            anonymous=False,
            ip_address='127.0.0.1',
        )

        feedback = DesuprogrammeFeedback.from_dict(payload)
        feedback.save(programme)

        feedback = ProgrammeFeedback.objects.get()
        assert feedback.programme == programme
        assert feedback.author is None
def create_new_programme(context):
    context.programme, unused = Programme.get_or_create_dummy()
    ProgrammeRole.get_or_create_dummy()
Example #5
0
    def test_hilzun_400(self):
        json = '{"feedback": "Test", "anonymous": true, "ip_address": "127.0.0.1", "desucon_username": ""}'
        programme, unused = Programme.get_or_create_dummy()

        feedback = DesuprogrammeFeedback.from_json(json)
        feedback.save(programme)
def create_another_programme(context):
    context.another_programme, unused = Programme.get_or_create_dummy(title=u'Another dummy programme')
    ProgrammeRole.get_or_create_dummy(programme=context.another_programme)