X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=quotes%2Ftest_quotes.py;h=d3e65e556aa6195dd87fa32f7c92d09b9b1b3a1d;hb=6d29db35c714fe52854a5b2e4002403150da1954;hp=ac53979f936f3214cf15adacdcc13c30e682d4e3;hpb=6bc7c03c1fa9c289e4fff457e5404bffbb595fe7;p=djsite.git diff --git a/quotes/test_quotes.py b/quotes/test_quotes.py index ac53979..d3e65e5 100644 --- a/quotes/test_quotes.py +++ b/quotes/test_quotes.py @@ -1,3 +1,5 @@ +# -*- encoding: utf-8 -*- + import pytest from .models import QuoteTag, Author, Work, Quote @@ -37,7 +39,7 @@ class Test_Views(): a2 = Author.objects.create(name="Author without notes") w2 = Work.objects.create(name="Work without notes", author=a2) q2 = Quote.objects.create(text="

Quote02, no tags

", work=w2) - assert len(q2.tags.all()) == 0 + assert q2.tags.all().count() == 0 def test_all(self, c): content = c.getPage('all/') @@ -51,6 +53,8 @@ class Test_Views(): assert q.text in content assert q.notes in content + c.checkAllLinks('all/', content) + @pytest.mark.slow def test_random(self, c): seen = {} @@ -140,3 +144,19 @@ class Test_Views(): authorpage = c.getPage('author/%s/' % a.id) assert authorpage.count("Some notes for the author") == 1 + +class Test_Unicode(): + def test_unicode(self, db): + a = Author.objects.create(name="ê è “smart ''quotes,”") + w = Work.objects.create(name="¿who?If you’re creati'' ng a", author=a) + q = Quote.objects.create(text="µqwer If you’r'' ¨ë ẽ « or » e ", work=w) + t = QuoteTag.objects.create(tag=", “s tag 'a’ ß") + + for t in QuoteTag.objects.all(): + print t + for w in Work.objects.all(): + print w + for a in Author.objects.all(): + print a + for q in Quote.objects.all(): + print q