Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
d8977b24
Commit
d8977b24
authored
Mar 25, 2018
by
Jelle van der Waa
🚧
Browse files
todolists: Add test for templatetags
Test a simple case of the todolist_details_link template tag
parent
ce0f2214
Changes
1
Hide whitespace changes
Inline
Side-by-side
todolists/tests/test_templatetags_todolists.py
0 → 100644
View file @
d8977b24
from
django.contrib.auth.models
import
User
from
django.test
import
TestCase
from
main.models
import
Package
from
todolists.models
import
Todolist
,
TodolistPackage
from
todolists.templatetags.todolists
import
todopkg_details_link
class
TestTodolist
(
TestCase
):
fixtures
=
[
'main/fixtures/arches.json'
,
'main/fixtures/repos.json'
,
'main/fixtures/package.json'
]
def
setUp
(
self
):
self
.
user
=
User
.
objects
.
create
(
username
=
"joeuser"
,
first_name
=
"Joe"
,
last_name
=
"User"
,
email
=
"user1@example.com"
)
self
.
todolist
=
Todolist
.
objects
.
create
(
name
=
'Boost rebuild'
,
description
=
'Boost 1.66 rebuid'
,
creator
=
self
.
user
,
raw
=
'linux'
)
def
test_details_link
(
self
):
pkg
=
Package
.
objects
.
first
()
todopkg
=
TodolistPackage
.
objects
.
create
(
pkg
=
pkg
,
pkgname
=
pkg
.
pkgname
,
pkgbase
=
pkg
.
pkgbase
,
arch
=
pkg
.
arch
,
repo
=
pkg
.
repo
,
user
=
self
.
user
,
todolist
=
self
.
todolist
)
link
=
todopkg_details_link
(
todopkg
)
self
.
assertIn
(
'View package details for {}'
.
format
(
todopkg
.
pkg
.
pkgname
),
link
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment