Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
bug 1173189: Refactor Document feed tests
Browse files Browse the repository at this point in the history
Convert Document feed tests to use pytest and fixtures. Existing tests
were converted (except for the silly parts), and then additional tests
added to get complete coverage.
  • Loading branch information
jwhitlock committed Jan 10, 2018
1 parent b9f0ef3 commit 7202d2c
Show file tree
Hide file tree
Showing 2 changed files with 460 additions and 266 deletions.
12 changes: 2 additions & 10 deletions kuma/wiki/tests/__init__.py
@@ -1,5 +1,4 @@
from datetime import datetime
import time

from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
Expand Down Expand Up @@ -86,13 +85,6 @@ def make_translation():
return d1, d2


def wait_add_rev(document):
# Let the clock tick, then update the translation parent.
time.sleep(1.0)
revision(document=document, save=True)
return document


# End model makers.


Expand All @@ -119,13 +111,13 @@ def __iter__(self):
yield token


def normalize_html(input):
def normalize_html(html):
"""
Normalize HTML5 input, discarding parts not significant for
equivalence in tests
"""
return (kuma.wiki.content
.parse(unicode(input))
.parse(unicode(html))
.filter(WhitespaceRemovalFilter)
.serialize(alphabetical_attributes=True))

Expand Down

0 comments on commit 7202d2c

Please sign in to comment.