@@ -154,8 +154,7 @@ def test_history_form_permission(self):
154154 def test_invalid_history_form (self ):
155155 self .login ()
156156 poll = Poll .objects .create (question = "why?" , pub_date = today )
157- with patch ("simple_history.admin.SIMPLE_HISTORY_EDIT" , True ):
158- response = self .client .post (get_history_url (poll , 0 ), data = {"question" : "" })
157+ response = self .client .post (get_history_url (poll , 0 ), data = {"question" : "" })
159158 self .assertEqual (response .status_code , 200 )
160159 self .assertContains (response , "This field is required" )
161160
@@ -201,25 +200,6 @@ def test_history_form(self):
201200 [p .history_user for p in Poll .history .all ()], [self .user , None , None ]
202201 )
203202
204- def test_readonly_history_form_without_setting_simple_history_edit (self ):
205- self .login ()
206- poll = Poll .objects .create (question = "why?" , pub_date = today )
207- poll .question = "how?"
208- poll .save ()
209- response = self .client .get (get_history_url (poll , 0 ))
210- readonly_fields = response .context ["adminform" ].readonly_fields
211- self .assertCountEqual (["question" , "pub_date" ], readonly_fields )
212-
213- def test_readonly_history_form_with_enabled_simple_history_edit (self ):
214- self .login ()
215- poll = Poll .objects .create (question = "why?" , pub_date = today )
216- poll .question = "how?"
217- poll .save ()
218- with patch ("simple_history.admin.SIMPLE_HISTORY_EDIT" , True ):
219- response = self .client .get (get_history_url (poll , 0 ))
220- readonly_fields = response .context ["adminform" ].readonly_fields
221- self .assertEqual (0 , len (readonly_fields ))
222-
223203 def test_history_user_on_save_in_admin (self ):
224204 self .login ()
225205
0 commit comments