tests: Add tests for selection of unicode projects and tags

This commit is contained in:
Tomas Babej 2017-01-07 19:37:40 +01:00
parent 5e601bcf97
commit edaebb9fb4

View file

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from tests.base import IntegrationTest
from time import sleep
@ -218,3 +219,74 @@ class TestChooseTagNoSelected(IntegrationTest):
assert self.tasks[0]['tags'] == set(["home"])
assert self.tasks[1]['tags'] == set()
class TestChooseProjectUnicode(IntegrationTest):
viminput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
vimoutput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
tasks = [
dict(description="test task 1", project=u"Hôme"),
dict(description="test task 2"),
]
def execute(self):
self.client.normal('2gg')
sleep(1)
self.command("TaskWikiChooseProject")
sleep(1)
self.client.normal('5gg')
sleep(0.5)
self.client.feedkeys("\\<CR>")
sleep(1)
for task in self.tasks:
task.refresh()
assert self.tasks[0]['project'] == u"Hôme"
assert self.tasks[1]['project'] == u"Hôme"
class TestChooseTagUnicode(IntegrationTest):
viminput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
vimoutput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
tasks = [
dict(description="test task 1", tags=[u"hôme"]),
dict(description="test task 2"),
]
def execute(self):
self.client.normal('2gg')
sleep(1)
self.command("TaskWikiChooseTag")
sleep(1)
self.client.normal('4gg')
sleep(0.5)
self.client.feedkeys("\\<CR>")
sleep(1)
for task in self.tasks:
task.refresh()
assert self.tasks[0]['tags'] == set([u"hôme"])
assert self.tasks[1]['tags'] == set([u"hôme"])