#9887: Testclient user have not enough permissions to create another users.
------------------------------------------------------+---------------------
          Reporter:  nuald <[email protected]>  |         Owner:  nobody
            Status:  new                              |     Milestone:        
         Component:  Testing framework                |       Version:  1.0   
        Resolution:                                   |      Keywords:        
             Stage:  Unreviewed                       |     Has_patch:  1     
        Needs_docs:  0                                |   Needs_tests:  0     
Needs_better_patch:  0                                |  
------------------------------------------------------+---------------------
Comment (by nuald <[email protected]>):

 Of course, let me describe an issue more detailed:
  - we have strict security policy in our application - only superusers or
 users with special permissions can create another users, and a usual user
 can modify only its own account with few restrictions;
  - automated admin sites in Django is not flexible enough - we can't allow
 user to modify only its own account without access to other accounts;
  - so we added pre_save handler for User model, and after that internal
 Django tests fails (because testclient user do not have superuser status,
 and it creates another users during these tests).

 The simple way to fix it - check if pre_save handler works in test
 environment and disable it during tests. But we didn't find a way how to
 do it correctly. Our study shows that a more clear way to fix it - give
 testclient user a superuser status. Of course, we didn't modify Django
 core in our case, and just add required fixture in our project. But I'm
 worry that this situation can happen with other Django developers.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9887#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to