Skip to content

Commit e9c3fff

Browse files
committed
add tests
1 parent d64ea88 commit e9c3fff

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/demoapp/demo/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ def disabled(self, request):
9696
def enabled(self, request):
9797
pass
9898

99+
@link(href="https://www.google.com/", visible=lambda btn: True)
100+
def invisible(self, button):
101+
button.visible = False
102+
99103
@button()
100104
def error_message(self, request):
101105
try:

tests/test_admin.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.urls import reverse
2+
3+
4+
def test_admin(app, admin_user):
5+
url = reverse('admin:demo_demomodel1_changelist')
6+
res = app.get(url, user=admin_user)
7+
assert res.status_code == 200

0 commit comments

Comments
 (0)