Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Reverted parts of r14891 and r16400 due to inherent brokenness of tests.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f4aa39837a8b7a49baa938911a531e7d2eb05c2d 1 parent 6fe2a8b
Jannis Leidel authored June 28, 2011
307  django/contrib/auth/fixtures/permissionstestdata.json
... ...
@@ -1,307 +0,0 @@
1  
-[
2  
-    {
3  
-        "pk": 4, 
4  
-        "model": "contenttypes.contenttype", 
5  
-        "fields": {
6  
-            "model": "contenttype", 
7  
-            "name": "content type", 
8  
-            "app_label": "contenttypes"
9  
-        }
10  
-    }, 
11  
-    {
12  
-        "pk": 2, 
13  
-        "model": "contenttypes.contenttype", 
14  
-        "fields": {
15  
-            "model": "group", 
16  
-            "name": "group", 
17  
-            "app_label": "auth"
18  
-        }
19  
-    }, 
20  
-    {
21  
-        "pk": 7, 
22  
-        "model": "contenttypes.contenttype", 
23  
-        "fields": {
24  
-            "model": "logentry", 
25  
-            "name": "log entry", 
26  
-            "app_label": "admin"
27  
-        }
28  
-    }, 
29  
-    {
30  
-        "pk": 1, 
31  
-        "model": "contenttypes.contenttype", 
32  
-        "fields": {
33  
-            "model": "permission", 
34  
-            "name": "permission", 
35  
-            "app_label": "auth"
36  
-        }
37  
-    }, 
38  
-    {
39  
-        "pk": 5, 
40  
-        "model": "contenttypes.contenttype", 
41  
-        "fields": {
42  
-            "model": "session", 
43  
-            "name": "session", 
44  
-            "app_label": "sessions"
45  
-        }
46  
-    }, 
47  
-    {
48  
-        "pk": 6, 
49  
-        "model": "contenttypes.contenttype", 
50  
-        "fields": {
51  
-            "model": "site", 
52  
-            "name": "site", 
53  
-            "app_label": "sites"
54  
-        }
55  
-    }, 
56  
-    {
57  
-        "pk": 3, 
58  
-        "model": "contenttypes.contenttype", 
59  
-        "fields": {
60  
-            "model": "user", 
61  
-            "name": "user", 
62  
-            "app_label": "auth"
63  
-        }
64  
-    }, 
65  
-    {
66  
-        "pk": 1, 
67  
-        "model": "sites.site", 
68  
-        "fields": {
69  
-            "domain": "example.com", 
70  
-            "name": "example.com"
71  
-        }
72  
-    }, 
73  
-    {
74  
-        "pk": 22, 
75  
-        "model": "auth.permission", 
76  
-        "fields": {
77  
-            "codename": "add_logentry", 
78  
-            "name": "Can add log entry", 
79  
-            "content_type": 8
80  
-        }
81  
-    }, 
82  
-    {
83  
-        "pk": 23, 
84  
-        "model": "auth.permission", 
85  
-        "fields": {
86  
-            "codename": "change_logentry", 
87  
-            "name": "Can change log entry", 
88  
-            "content_type": 8
89  
-        }
90  
-    }, 
91  
-    {
92  
-        "pk": 24, 
93  
-        "model": "auth.permission", 
94  
-        "fields": {
95  
-            "codename": "delete_logentry", 
96  
-            "name": "Can delete log entry", 
97  
-            "content_type": 8
98  
-        }
99  
-    }, 
100  
-    {
101  
-        "pk": 4, 
102  
-        "model": "auth.permission", 
103  
-        "fields": {
104  
-            "codename": "add_group", 
105  
-            "name": "Can add group", 
106  
-            "content_type": 2
107  
-        }
108  
-    }, 
109  
-    {
110  
-        "pk": 5, 
111  
-        "model": "auth.permission", 
112  
-        "fields": {
113  
-            "codename": "change_group", 
114  
-            "name": "Can change group", 
115  
-            "content_type": 2
116  
-        }
117  
-    }, 
118  
-    {
119  
-        "pk": 6, 
120  
-        "model": "auth.permission", 
121  
-        "fields": {
122  
-            "codename": "delete_group", 
123  
-            "name": "Can delete group", 
124  
-            "content_type": 2
125  
-        }
126  
-    }, 
127  
-    {
128  
-        "pk": 10, 
129  
-        "model": "auth.permission", 
130  
-        "fields": {
131  
-            "codename": "add_message", 
132  
-            "name": "Can add message", 
133  
-            "content_type": 4
134  
-        }
135  
-    }, 
136  
-    {
137  
-        "pk": 11, 
138  
-        "model": "auth.permission", 
139  
-        "fields": {
140  
-            "codename": "change_message", 
141  
-            "name": "Can change message", 
142  
-            "content_type": 4
143  
-        }
144  
-    }, 
145  
-    {
146  
-        "pk": 12, 
147  
-        "model": "auth.permission", 
148  
-        "fields": {
149  
-            "codename": "delete_message", 
150  
-            "name": "Can delete message", 
151  
-            "content_type": 4
152  
-        }
153  
-    }, 
154  
-    {
155  
-        "pk": 1, 
156  
-        "model": "auth.permission", 
157  
-        "fields": {
158  
-            "codename": "add_permission", 
159  
-            "name": "Can add permission", 
160  
-            "content_type": 1
161  
-        }
162  
-    }, 
163  
-    {
164  
-        "pk": 2, 
165  
-        "model": "auth.permission", 
166  
-        "fields": {
167  
-            "codename": "change_permission", 
168  
-            "name": "Can change permission", 
169  
-            "content_type": 1
170  
-        }
171  
-    }, 
172  
-    {
173  
-        "pk": 3, 
174  
-        "model": "auth.permission", 
175  
-        "fields": {
176  
-            "codename": "delete_permission", 
177  
-            "name": "Can delete permission", 
178  
-            "content_type": 1
179  
-        }
180  
-    }, 
181  
-    {
182  
-        "pk": 7, 
183  
-        "model": "auth.permission", 
184  
-        "fields": {
185  
-            "codename": "add_user", 
186  
-            "name": "Can add user", 
187  
-            "content_type": 3
188  
-        }
189  
-    }, 
190  
-    {
191  
-        "pk": 8, 
192  
-        "model": "auth.permission", 
193  
-        "fields": {
194  
-            "codename": "change_user", 
195  
-            "name": "Can change user", 
196  
-            "content_type": 3
197  
-        }
198  
-    }, 
199  
-    {
200  
-        "pk": 9, 
201  
-        "model": "auth.permission", 
202  
-        "fields": {
203  
-            "codename": "delete_user", 
204  
-            "name": "Can delete user", 
205  
-            "content_type": 3
206  
-        }
207  
-    }, 
208  
-    {
209  
-        "pk": 13, 
210  
-        "model": "auth.permission", 
211  
-        "fields": {
212  
-            "codename": "add_contenttype", 
213  
-            "name": "Can add content type", 
214  
-            "content_type": 5
215  
-        }
216  
-    }, 
217  
-    {
218  
-        "pk": 14, 
219  
-        "model": "auth.permission", 
220  
-        "fields": {
221  
-            "codename": "change_contenttype", 
222  
-            "name": "Can change content type", 
223  
-            "content_type": 5
224  
-        }
225  
-    }, 
226  
-    {
227  
-        "pk": 15, 
228  
-        "model": "auth.permission", 
229  
-        "fields": {
230  
-            "codename": "delete_contenttype", 
231  
-            "name": "Can delete content type", 
232  
-            "content_type": 5
233  
-        }
234  
-    }, 
235  
-    {
236  
-        "pk": 16, 
237  
-        "model": "auth.permission", 
238  
-        "fields": {
239  
-            "codename": "add_session", 
240  
-            "name": "Can add session", 
241  
-            "content_type": 6
242  
-        }
243  
-    }, 
244  
-    {
245  
-        "pk": 17, 
246  
-        "model": "auth.permission", 
247  
-        "fields": {
248  
-            "codename": "change_session", 
249  
-            "name": "Can change session", 
250  
-            "content_type": 6
251  
-        }
252  
-    }, 
253  
-    {
254  
-        "pk": 18, 
255  
-        "model": "auth.permission", 
256  
-        "fields": {
257  
-            "codename": "delete_session", 
258  
-            "name": "Can delete session", 
259  
-            "content_type": 6
260  
-        }
261  
-    }, 
262  
-    {
263  
-        "pk": 19, 
264  
-        "model": "auth.permission", 
265  
-        "fields": {
266  
-            "codename": "add_site", 
267  
-            "name": "Can add site", 
268  
-            "content_type": 7
269  
-        }
270  
-    }, 
271  
-    {
272  
-        "pk": 20, 
273  
-        "model": "auth.permission", 
274  
-        "fields": {
275  
-            "codename": "change_site", 
276  
-            "name": "Can change site", 
277  
-            "content_type": 7
278  
-        }
279  
-    }, 
280  
-    {
281  
-        "pk": 21, 
282  
-        "model": "auth.permission", 
283  
-        "fields": {
284  
-            "codename": "delete_site", 
285  
-            "name": "Can delete site", 
286  
-            "content_type": 7
287  
-        }
288  
-    }, 
289  
-    {
290  
-        "pk": 1, 
291  
-        "model": "auth.user", 
292  
-        "fields": {
293  
-            "username": "admin", 
294  
-            "first_name": "", 
295  
-            "last_name": "", 
296  
-            "is_active": true, 
297  
-            "is_superuser": true, 
298  
-            "is_staff": true, 
299  
-            "last_login": "2010-11-19 06:26:59", 
300  
-            "groups": [], 
301  
-            "user_permissions": [], 
302  
-            "password": "sha1$e72a2$950781326ec9546d172a20681ba3c762f23104b0", 
303  
-            "email": "admin@example.com", 
304  
-            "date_joined": "2010-11-19 06:26:59"
305  
-        }
306  
-    }
307  
-]
38  django/contrib/auth/tests/permissions.py
... ...
@@ -1,38 +0,0 @@
1  
-try:
2  
-    from cStringIO import StringIO
3  
-except ImportError:
4  
-    from StringIO import StringIO
5  
-
6  
-from django.contrib.auth.management import create_permissions
7  
-from django.contrib.auth import models as auth_models
8  
-from django.contrib.contenttypes import models as contenttypes_models
9  
-from django.core.management import call_command
10  
-from django.test import TestCase
11  
-
12  
-
13  
-class TestAuthPermissions(TestCase):
14  
-    def tearDown(self):
15  
-        # These tests mess with content types, but content type lookups
16  
-        # are cached, so we need to make sure the effects of this test
17  
-        # are cleaned up.
18  
-        contenttypes_models.ContentType.objects.clear_cache()
19  
-
20  
-    def test_permission_register_order(self):
21  
-        """Test that the order of registered permissions doesn't break"""
22  
-        # Changeset 14413 introduced a regression in the ordering of
23  
-        # newly created permissions for objects. When loading a fixture
24  
-        # after the initial creation (such as during unit tests), the
25  
-        # expected IDs for the permissions may not match up, leading to
26  
-        # SQL errors. This is ticket 14731
27  
-
28  
-        # Start with a clean slate and build the permissions as we
29  
-        # expect to see them in the fixtures.
30  
-        auth_models.Permission.objects.all().delete()
31  
-        contenttypes_models.ContentType.objects.all().delete()
32  
-        create_permissions(auth_models, [], verbosity=0)
33  
-        create_permissions(contenttypes_models, [], verbosity=0)
34  
-
35  
-        stdout = StringIO()
36  
-        call_command('loaddata', 'permissionstestdata.json',
37  
-                     verbosity=1, commit=False, stdout=stdout)
38  
-        self.assertNotEqual(stdout.getvalue(), 'No fixtures found.\n')

0 notes on commit f4aa398

Please sign in to comment.
Something went wrong with that request. Please try again.