Thanks for the hint:
self.assertEqual(u"2011/1", unicode(invoice))
works
On 25 Aug., 12:41, Alasdair Nicol wrote:
> On 25/08/11 11:34, Torsten wrote:
>
>
>
>
>
>
>
> > Hi
>
> > How do I do that right ?
>
> > I have a class like:
>
> > class Invoice
> > ...
> > def __unicode__(self):
> >
On 25/08/11 11:34, Torsten wrote:
Hi
How do I do that right ?
I have a class like:
class Invoice
...
def __unicode__(self):
return unicode(str(self.created_at.year)+'/'+str(self.id))
and an test here:
def test_invoice_number(self):
invoice = Invoice.objects.create(created_
Well, call unicode(MyObject) and assert equals u'myRepr'
Le 25 août 2011 12:34, "Torsten" a écrit :
> Hi
>
> How do I do that right ?
>
> I have a class like:
>
> class Invoice
> ...
> def __unicode__(self):
> return unicode(str(self.created_at.year)+'/'+str(self.id))
>
> and an test here:
>
>
> d
3 matches
Mail list logo