Unverified Commit 66703ae8 authored by Thom Wiggers's avatar Thom Wiggers 📐

Also run doctests

parent 2ef645cc
......@@ -46,6 +46,7 @@ docs:
# install doc deps
- pip install -r requirements.txt
script:
- env -u GITLAB_CI make doctest
- test -z "$(env -u GITLAB_CI make html | egrep -w 'SEVERE:|ERROR:')"
cache:
......
......@@ -45,6 +45,7 @@ django.setup()
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode']
......
"""
Template filters to partition lists into rows or columns.
From https://djangosnippets.org/snippets/401/
A common use-case is for splitting a list into a table with columns::
{% load partition %}
......@@ -116,7 +118,7 @@ def columns(thelist, n):
>>> from pprint import pprint
>>> for i in range(7, 11):
... print '%sx%s:' % (i, 3)
... print('%sx%s:' % (i, 3))
... pprint(columns(range(i), 3), width=20)
7x3:
[[0, 3, 6],
......
import doctest
from django.conf import settings
from django.contrib.auth.models import User, Permission
from django.core import mail
......@@ -7,6 +9,16 @@ from django.urls import reverse
from django.utils import timezone
from newsletters.models import Newsletter, NewsletterEvent
from newsletters.templatetags import listutil
def load_tests(loader, tests, ignore):
"""
Load all tests in this module
"""
# Adds the doctests in listutil
tests.addTests(doctest.DocTestSuite(listutil))
return tests
class NewslettersTest(TestCase):
......
Markdown is supported
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