mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
Added some tests.
This commit is contained in:
parent
6ff47746df
commit
eb204104bd
2 changed files with 12 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ class CommentAdmin(djadmin2.ModelAdmin2):
|
|||
list_filter = ['post', ]
|
||||
actions_on_top = True
|
||||
actions_on_bottom = True
|
||||
actions_selection_counter = False
|
||||
|
||||
|
||||
# Register each model with the admin
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ class CommentListTest(BaseIntegrationTest):
|
|||
self.assertContains(response, "comment_post_1_b")
|
||||
self.assertNotContains(response, "comment_post_2")
|
||||
|
||||
def test_list_selected_hides(self):
|
||||
post_1 = Post.objects.create(title="post_1_title", body="body")
|
||||
Comment.objects.create(body="comment_post1_body", post=post_1)
|
||||
response = self.client.get(reverse("admin2:blog_comment_index"))
|
||||
self.assertNotContains(response, "of 1 selected")
|
||||
|
||||
|
||||
class PostListTest(BaseIntegrationTest):
|
||||
def test_view_ok(self):
|
||||
|
|
@ -64,6 +70,11 @@ class PostListTest(BaseIntegrationTest):
|
|||
response = self.client.get(reverse("admin2:blog_post_index"))
|
||||
self.assertContains(response, 'id="list_filter_container"')
|
||||
|
||||
def test_list_selected_shows(self):
|
||||
Post.objects.create(title="post_1_title", body="body")
|
||||
response = self.client.get(reverse("admin2:blog_post_index"))
|
||||
self.assertContains(response, 'class="selected-count"')
|
||||
|
||||
def test_actions_displayed(self):
|
||||
response = self.client.get(reverse("admin2:blog_post_index"))
|
||||
self.assertInHTML('<a tabindex="-1" href="#" data-name="action" data-value="DeleteSelectedAction">Delete selected items</a>', response.content)
|
||||
|
|
|
|||
Loading…
Reference in a new issue