Esempio n. 1
0
 def test_delete_permission_has_created_tagging(self):
     self.episode.set_tag_names(['sssssh'], user=self.user)
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 2
0
 def test_delete_permission_has_created_tagging(self):
     self.episode.set_tag_names(['sssssh'], user=self.user)
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 3
0
 def test_delete_permission_has_updated_episode(self):
     self.episode.updated_by = self.user
     self.episode.save()
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 4
0
 def test_delete_permission_has_updated_episode(self):
     self.episode.updated_by = self.user
     self.episode.save()
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 5
0
 def test_delete_permission_has_updated_subrecord(self):
     dem = self.patient.demographics()
     dem.updated_by = self.user
     dem.save()
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 6
0
 def test_delete_permission_has_updated_subrecord(self):
     dem = self.patient.demographics()
     dem.updated_by = self.user
     dem.save()
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertFalse(has_perm)
Esempio n. 7
0
 def test_delete_permission_obj_is_none(self):
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request)
     self.assertTrue(has_perm)
Esempio n. 8
0
 def test_delete_permission_has_been_lazy_and_done_nothing(self):
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertTrue(has_perm)
Esempio n. 9
0
 def test_delete_permission_has_been_lazy_and_done_nothing(self):
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request, obj=self.user)
     self.assertTrue(has_perm)
Esempio n. 10
0
 def test_delete_permission_obj_is_none(self):
     request = self.rf.get('/admin/meh/')
     request.user = self.user
     admin = UserProfileAdmin(self.user, self.site)
     has_perm = admin.has_delete_permission(request)
     self.assertTrue(has_perm)
Esempio n. 11
0
 def test_get_actions(self):
     request = self.rf.get('/admin/meh/')
     actions = UserProfileAdmin(self.user, self.site).get_actions(request)
     self.assertNotIn('delete_selected', actions)