Commit d8977b24 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

todolists: Add test for templatetags

Test a simple case of the todolist_details_link template tag
parent ce0f2214
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',
def setUp(self):
self.user = User.objects.create(username="joeuser", first_name="Joe",
last_name="User", email="")
self.todolist = Todolist.objects.create(name='Boost rebuild',
description='Boost 1.66 rebuid',
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,
link = todopkg_details_link(todopkg)
self.assertIn('View package details for {}'.format(todopkg.pkg.pkgname), link)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment