コード例 #1
0
    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,))
コード例 #2
0
    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, '')
コード例 #3
0
    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)