Beispiel #1
0
    def test_user_must_be_staff(self):
        user = User.objects.filter(username='******')[0]

        f = VolunteerAdminForm()
        f.cleaned_data = {'user': user}
        try:
            f.clean_user()
        except forms.ValidationError, err:
            eq_(err.messages[0], (
                "User plainuser_not_staff cannot be a volunteer because he/she "
                "has not been marked with Staff status (you can fix this in Home > "
                "Auth > Users under the Permissions section)"))
    def test_user_must_be_staff(self):
        user = User.objects.filter(username='******')[0]

        f = VolunteerAdminForm()
        f.cleaned_data= {'user': user}
        try:
            f.clean_user()
        except forms.ValidationError, err:
            eq_(err.messages[0], (
                "User plainuser_not_staff cannot be a volunteer because he/she "
                "has not been marked with Staff status (you can fix this in Home > "
                "Auth > Users under the Permissions section)"))
Beispiel #3
0
    def test_user_must_be_volunteer(self):
        user = User.objects.filter(username='******')[0]

        f = VolunteerAdminForm()
        f.cleaned_data = {'user': user}
        try:
            f.clean_user()
        except forms.ValidationError, err:
            eq_(err.messages[0],
                ("User plainuser cannot be a volunteer because he/she is not "
                 "in the Volunteer group (You can fix this in Home > Auth > "
                 "Users under the Groups section)"))
    def test_user_must_be_volunteer(self):
        user = User.objects.filter(username='******')[0]

        f = VolunteerAdminForm()
        f.cleaned_data= {'user': user}
        try:
            f.clean_user()
        except forms.ValidationError, err:
            eq_(err.messages[0], (
                "User plainuser cannot be a volunteer because he/she is not "
                "in the Volunteer group (You can fix this in Home > Auth > "
                "Users under the Groups section)"))