Ticket #15968: 15968-testcase.patch
File 15968-testcase.patch, 1.4 KB (added by , 14 years ago) |
---|
-
tests/regressiontests/admin_views/tests.py
2683 2683 response = self.client.get('/test_admin/admin/admin_views/pizza/add/') 2684 2684 self.assertEqual(response.status_code, 200) 2685 2685 2686 def test_readonly_form_label(self): 2687 "Regression test for #15968" 2688 response = self.client.get('/test_admin/admin/admin_views/pizza/add/') 2689 self.assertIn('customer requirement', response.content) 2686 2690 2687 2691 class RawIdFieldsTest(TestCase): 2688 2692 fixtures = ['admin-views-users.xml'] -
tests/regressiontests/admin_views/models.py
691 691 class Pizza(models.Model): 692 692 name = models.CharField(max_length=20) 693 693 toppings = models.ManyToManyField('Topping') 694 comments = models.CharField(max_length=100) 694 695 696 class PizzaForm(forms.ModelForm): 697 comments = forms.CharField(label='customer requirements') 698 695 699 class PizzaAdmin(admin.ModelAdmin): 696 readonly_fields = ('toppings',) 700 form = PizzaForm 701 readonly_fields = ('toppings', 'comments') 697 702 698 703 class Album(models.Model): 699 704 owner = models.ForeignKey(User)