def test_unicode(self): user = User(username='******') user.save() sheet = Sheet(owner=user, name='sheet to feature') sheet.save() description = 'twas brillig and the slithy toves' more_info_url = 'http://far.away/' fs = FeaturedSheet(sheet=sheet, description=description, more_info_url=more_info_url) fs.save() self.assertEquals(unicode(fs), u'Feature: %s' % (sheet.name,))
def test_can_construct_without_more_info_url(self): user = User(username='******') user.save() sheet = Sheet(owner=user, name='sheet to feature') sheet.save() description = 'twas brillig and the slithy toves' fs = FeaturedSheet(sheet=sheet, description=description) fs.save() self.assertEquals(fs.sheet, sheet) self.assertEquals(fs.description, description) self.assertEquals(fs.more_info_url, '')
def test_can_construct_with_more_info_url(self): user = User(username='******') user.save() sheet = Sheet(owner=user, name='sheet to feature') sheet.save() description = 'twas brillig and the slithy toves' more_info_url = 'http://far.away/' fs = FeaturedSheet(sheet=sheet, description=description, more_info_url=more_info_url) fs.save() self.assertEquals(fs.sheet, sheet) self.assertEquals(fs.description, description) self.assertEquals(fs.more_info_url, more_info_url)
def test_unicode(self): user = User(username='******') user.save() sheet = Sheet(owner=user, name='sheet to feature') sheet.save() description = 'twas brillig and the slithy toves' more_info_url = 'http://far.away/' fs = FeaturedSheet(sheet=sheet, description=description, more_info_url=more_info_url) fs.save() self.assertEquals(unicode(fs), u'Feature: %s' % (sheet.name, ))