Esempio n. 1
0
    def test_change_invalid_bugzilla_email(self):
        """Test change bugzilla email with an invalid one."""
        mentor = UserFactory.create(groups=["Mentor"], userprofile__initial_council=True)
        rep = UserFactory.create(groups=["Rep"], userprofile__mentor=mentor)
        data = {"first_name": rep.first_name, "last_name": rep.last_name, "email": mentor.email}

        form = ChangeUserForm(data=data, instance=rep)
        ok_(not form.is_valid())
Esempio n. 2
0
    def test_change_invalid_bugzilla_email(self):
        """Test change bugzilla email with an invalid one."""
        data = {
            "first_name": self.first_user.first_name,
            "last_name": self.first_user.last_name,
            "email": self.second_user.email,
        }

        form = ChangeUserForm(data=data, instance=self.first_user)
        ok_(not form.is_valid())
Esempio n. 3
0
    def test_change_invalid_bugzilla_email(self):
        """Test change bugzilla email with an invalid one."""
        data = {
            'first_name': self.first_user.first_name,
            'last_name': self.first_user.last_name,
            'email': self.second_user.email
        }

        form = ChangeUserForm(data=data, instance=self.first_user)
        ok_(not form.is_valid())
Esempio n. 4
0
    def test_change_valid_bugzilla_email(self):
        """Test change bugzilla email with a valid one."""
        mentor = UserFactory.create(groups=['Mentor'], userprofile__initial_council=True)
        rep = UserFactory.create(groups=['Rep'], userprofile__mentor=mentor, last_name='Doe')
        data = {'first_name': rep.first_name,
                'last_name': rep.last_name,
                'email': rep.email}

        form = ChangeUserForm(data=data, instance=rep)
        ok_(form.is_valid())
Esempio n. 5
0
    def test_change_invalid_login_email(self):
        """Test change login email with an invalid one."""
        mentor = UserFactory.create(groups=['Mentor'], userprofile__initial_council=True)
        rep = UserFactory.create(groups=['Rep'], userprofile__mentor=mentor)
        data = {'first_name': rep.first_name,
                'last_name': rep.last_name,
                'email': mentor.email}

        form = ChangeUserForm(data=data, instance=rep)
        ok_(not form.is_valid())
Esempio n. 6
0
    def test_change_valid_bugzilla_email(self):
        """Test change bugzilla email with a valid one."""
        mentor = UserFactory.create(groups=['Mentor'],
                                    userprofile__initial_council=True)
        rep = UserFactory.create(groups=['Rep'],
                                 userprofile__mentor=mentor,
                                 last_name='Doe')
        data = {
            'first_name': rep.first_name,
            'last_name': rep.last_name,
            'email': rep.email
        }

        form = ChangeUserForm(data=data, instance=rep)
        ok_(form.is_valid())