Commit 534e3f7e authored by Damien Lespiau's avatar Damien Lespiau
Browse files

models: Fix __str__() for Revision



Unfortunately, there were no test coverage for it. As penitence, I wrote
a test.
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
parent 912845f1
......@@ -540,7 +540,7 @@ class SeriesRevision(models.Model):
return new
def __unicode__(self):
return "Revision " + self.version
return "Revision " + str(self.version)
class SeriesRevisionPatch(models.Model):
patch = models.ForeignKey(Patch)
......
......@@ -108,6 +108,14 @@ class BasicGeneratedSeriesTests(GeneratedSeriesTest):
series.insert(mails)
self.commonInsertionChecks()
def testStringRepresentation(self):
series = TestSeries(2)
series.insert()
series = Series.objects.all()[0]
self.assertEquals(str(series), defaults.series_name)
revision = series.revisions()[0]
self.assertEquals(str(revision), 'Revision 1')
class IntelGfxTest(SeriesTest):
project = Project(linkname = 'intel-gfx',
name = 'Intel Gfx',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment