tests: Add tests for tasks with unicode

This commit is contained in:
Tomas Babej 2015-08-09 19:12:42 +02:00
parent a981523d88
commit 4b2514e731
2 changed files with 43 additions and 0 deletions

View file

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from tests.base import IntegrationTest
from time import sleep
@ -136,3 +137,22 @@ class TestViewportInspection(IntegrationTest):
sleep(0.5)
assert self.command(":py print vim.current.buffer", regex="<buffer taskwiki.")
class TestViewportsUnicodeTaskGeneration(IntegrationTest):
viminput = """
=== Work tasks | +work ===
"""
vimoutput = u"""
=== Work tasks | +work ===
* [ ] tag work täsk #{uuid}
"""
tasks = [
dict(description=u"tag work täsk", tags=['work']),
]
def execute(self):
self.command("w", regex="written$", lines=1)

View file

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from tasklib import local_zone
from tests.base import IntegrationTest, MultipleSourceTest
@ -301,3 +303,24 @@ class TestCreationDifferentTaskSource(MultipleSourceTest):
# Check that corect data store has been used
assert len(self.tw.tasks.all()) == 0
assert len(self.extra_tw.tasks.all()) == 1
class TestSimpleUnicodeTaskCreation(IntegrationTest):
viminput = u"""
* [ ] This is a test täsk
"""
vimoutput = u"""
* [ ] This is a test täsk #{uuid}
"""
def execute(self):
self.command("w", regex="written$", lines=1)
# Check that only one tasks with this description exists
assert len(self.tw.tasks.pending()) == 1
task = self.tw.tasks.pending()[0]
assert task['description'] == u'This is a test täsk'
assert task['status'] == 'pending'