Beispiel #1
0
    def test_update_person_populates_updated_by(self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.volunteer_user)

        person.middle_name = 'Ignatius'

        person.save(self.volunteer_user)

        self.assertEqual(person.updated_by, self.volunteer_user)
Beispiel #2
0
    def test_update_person_populates_updated_by(self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.volunteer_user)

        person.middle_name = 'Ignatius'

        person.save(self.volunteer_user)

        self.assertEqual(person.updated_by, self.volunteer_user)
Beispiel #3
0
    def test_update_is_public_to_true_populates_approved_by__for_superusers(self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.superuser)

        person.middle_name = 'Ignatius'
        person.is_public = True

        person.save(self.superuser)

        self.assertEqual(person.approved_by, self.superuser)
Beispiel #4
0
    def test_update_is_public_to_true_doesnt_populate_approved_by__for_users_in_wrong_group(self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.volunteer_user)

        person.middle_name = 'Ignatius'
        person.is_public = True

        person.save(self.volunteer_user)

        self.assertIsNone(person.approved_by)
Beispiel #5
0
    def test_update_is_public_to_true_populates_approved_by__for_superusers(
            self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.superuser)

        person.middle_name = 'Ignatius'
        person.is_public = True

        person.save(self.superuser)

        self.assertEqual(person.approved_by, self.superuser)
Beispiel #6
0
    def test_update_is_public_to_true_doesnt_populate_approved_by__for_users_in_wrong_group(
            self):
        person = Person(
            first_name='Joe',
            middle_name='Herbert',
            last_name='Schmoe',
            suffix='PhD',
        )
        person.save(self.volunteer_user)

        person.middle_name = 'Ignatius'
        person.is_public = True

        person.save(self.volunteer_user)

        self.assertIsNone(person.approved_by)