Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "admin/base_site.html" %}{% load concurrency %}
{% load i18n l10n %}
{% load url from future %}
{% load admin_urls %}

{% block breadcrumbs %}
Expand Down
18 changes: 18 additions & 0 deletions tests/test_admin_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,21 @@ def test_delete_not_allowed_if_updates(self):
sel.checked = True
res = form.submit().follow()
self.assertIn('One or more record were updated', res)


@pytest.mark.django_db
def test_deleteaction(self):
id = next(unique_id)

SimpleConcurrentModel.objects.get_or_create(pk=id)
response = self.app.get(django.core.urlresolvers.reverse('admin:demo_simpleconcurrentmodel_changelist'),
user='sax')
form = response.forms['changelist-form']
form.get('_selected_action', index=0).checked = True
form['action'] = 'delete_selected'
response = form.submit()
expected = 'All of the following objects and their related items will be deleted'
assert expected in response
response = response.form.submit().follow()
assert response.status_code == 200