help_text="Date of death (leave blank \
if still alive!)")
- def __str__(self):
+ def __unicode__(self):
return self.name
def get_absolute_url(self):
tags = models.ManyToManyField(WorkTag, blank=True,
help_text='Not implemented yet')
- def __str__(self):
+ def __unicode__(self):
return "%s: %s (%s)" % (self.author.name, self.name, self.date)
def get_absolute_url(self):
tags = models.ManyToManyField(QuoteTag, blank=True)
work = models.ForeignKey(Work)
- def __str__(self):
+ def __unicode__(self):
return self.work.author.name + ": " + self.text
def get_absolute_url(self):
+# -*- encoding: utf-8 -*-
+
import pytest
from .models import QuoteTag, Author, Work, Quote
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