diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html
index a8ced39..b4b6ef7 100644
a
|
b
|
|
14 | 14 | |
15 | 15 | {% if app_list %} |
16 | 16 | {% for app in app_list %} |
17 | | <div class="module"> |
| 17 | <div class="module" id="app-{{ app.name }}-module"> |
18 | 18 | <table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}"> |
19 | 19 | <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with name=app.name %}{{ name }}{% endblocktrans %}</a></caption> |
20 | 20 | {% for model in app.models %} |
diff --git a/tests/regressiontests/admin_individual_ids/__init__.py b/tests/regressiontests/admin_individual_ids/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/regressiontests/admin_individual_ids/admin.py b/tests/regressiontests/admin_individual_ids/admin.py
new file mode 100644
index 0000000..330361c
-
|
+
|
|
| 1 | from django.contrib import admin |
| 2 | |
| 3 | from models import * |
| 4 | |
| 5 | site = admin.AdminSite(name="admin") |
| 6 | |
| 7 | site.register(Poll) |
diff --git a/tests/regressiontests/admin_individual_ids/fixtures/admin-views-users.xml b/tests/regressiontests/admin_individual_ids/fixtures/admin-views-users.xml
new file mode 100644
index 0000000..aba8f4a
-
|
+
|
|
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <django-objects version="1.0"> |
| 3 | <object pk="100" model="auth.user"> |
| 4 | <field type="CharField" name="username">super</field> |
| 5 | <field type="CharField" name="first_name">Super</field> |
| 6 | <field type="CharField" name="last_name">User</field> |
| 7 | <field type="CharField" name="email">super@example.com</field> |
| 8 | <field type="CharField" name="password">sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158</field> |
| 9 | <field type="BooleanField" name="is_staff">True</field> |
| 10 | <field type="BooleanField" name="is_active">True</field> |
| 11 | <field type="BooleanField" name="is_superuser">True</field> |
| 12 | <field type="DateTimeField" name="last_login">2007-05-30 13:20:10</field> |
| 13 | <field type="DateTimeField" name="date_joined">2007-05-30 13:20:10</field> |
| 14 | <field to="auth.group" name="groups" rel="ManyToManyRel"></field> |
| 15 | <field to="auth.permission" name="user_permissions" rel="ManyToManyRel"></field> |
| 16 | </object> |
| 17 | </django-objects> |
diff --git a/tests/regressiontests/admin_individual_ids/models.py b/tests/regressiontests/admin_individual_ids/models.py
new file mode 100644
index 0000000..bb8e8b4
-
|
+
|
|
| 1 | """ |
| 2 | Testing of individual ids for models in Admin. |
| 3 | |
| 4 | """ |
| 5 | from django.db import models |
| 6 | |
| 7 | class Poll(models.Model): |
| 8 | name = models.CharField(max_length=40) |
diff --git a/tests/regressiontests/admin_individual_ids/tests.py b/tests/regressiontests/admin_individual_ids/tests.py
new file mode 100644
index 0000000..c7959de
-
|
+
|
|
| 1 | from __future__ import absolute_import |
| 2 | |
| 3 | from django.test import TestCase |
| 4 | |
| 5 | |
| 6 | class TestIndividualIds(TestCase): |
| 7 | urls = "regressiontests.admin_individual_ids.urls" |
| 8 | fixtures = ['admin-views-users.xml'] |
| 9 | |
| 10 | def setUp(self): |
| 11 | self.change_url = '/admin/' |
| 12 | |
| 13 | result = self.client.login(username='super', password='secret') |
| 14 | self.assertEqual(result, True) |
| 15 | |
| 16 | def tearDown(self): |
| 17 | self.client.logout() |
| 18 | |
| 19 | def test_are_ids_ok(self): |
| 20 | """Test if the ids are there and if they are right.""" |
| 21 | response = self.client.get(self.change_url) |
| 22 | self.assertContains(response, '<div class="module" id="app-Admin_Individual_Ids-module">') |
| 23 | |
diff --git a/tests/regressiontests/admin_individual_ids/urls.py b/tests/regressiontests/admin_individual_ids/urls.py
new file mode 100644
index 0000000..cf18ef9
-
|
+
|
|
| 1 | from __future__ import absolute_import |
| 2 | |
| 3 | from django.conf.urls import patterns, include |
| 4 | |
| 5 | from . import admin |
| 6 | |
| 7 | |
| 8 | urlpatterns = patterns('', |
| 9 | (r'^admin/', include(admin.site.urls)), |
| 10 | ) |