Ejemplo n.º 1
0
    def test_update_account_user_with_success(self):
        data = {
            'user': self.user.id,
            'name': 'siminino',
            'description': 'simi test',
            'type': 'Student',
            'tshirt': 'M',
            'gender': 'male',
            'locale': 'AC',
        }

        request = RequestFactory().post('/', data)
        request.user = self.request.user
        response = ProfileView().dispatch(request)
        self.assertEqual(302, response.status_code)

        profile = AccountProfile.objects.get(id=self.account_profile.id)
        self.assertEqual('siminino', profile.name)
        self.assertEqual('simi test', profile.description)
        self.assertEqual('Student', profile.type)
        self.assertEqual('M', profile.tshirt)
Ejemplo n.º 2
0
 def test_form_should_be_SpeakerProfileForm_when_type_is_speaker(self):
     v = ProfileView()
     v.object = AccountProfile(type="Speaker")
     self.assertEqual(SpeakerProfileForm, v.get_form_class())