Changeset 443 in main


Ignore:
Timestamp:
11/02/11 17:18:59 (8 years ago)
Author:
pcosquer
Message:

test++

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/tests/views.py

    r440 r443  
    299299        self.assertTrue(user.groups.filter(id=self.group.id)) 
    300300 
     301    def test_modify_get(self): 
     302        response = self.client.get(self.user_url + "modify/") 
     303        self.assertEqual(response.status_code,  200) 
     304        form = response.context["modification_form"] 
     305        self.assertEqual(self.user.first_name, form.initial["first_name"]) 
     306        self.assertEqual(self.user.email, form.initial["email"]) 
     307 
     308    def test_modify_post(self): 
     309        data = {"last_name":"Snow", "email":"user@test.com", "first_name":"John"} 
     310        response = self.client.post(self.user_url + "modify/", data, 
     311                follow=True) 
     312        self.assertEqual(response.status_code,  200) 
     313        user = User.objects.get(username=self.user.username) 
     314        self.assertEqual("Snow", user.last_name) 
    301315 
    302316from django.core.management import call_command 
Note: See TracChangeset for help on using the changeset viewer.