[v3,2/5] tests: Hardcode expected values

Message ID 20180921175105.18000-3-stephen@that.guru
State New
Headers show
Series
  • Convert Series-Patch relationship to 1:N
Related show

Commit Message

Stephen Finucane Sept. 21, 2018, 5:51 p.m.
Compare against known values to ensure bugs introduced in the function
are caught.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Daniel Axtens <dja@axtens.net>
---
 patchwork/tests/test_series.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Patch

diff --git a/patchwork/tests/test_series.py b/patchwork/tests/test_series.py
index bb44e39d..ff3412e6 100644
--- a/patchwork/tests/test_series.py
+++ b/patchwork/tests/test_series.py
@@ -623,10 +623,6 @@  class SeriesNameTestCase(TestCase):
     def _parse_mail(self, mail):
         return parser.parse_mail(mail, self.project.listid)
 
-    @staticmethod
-    def _format_name(cover):
-        return models.Series._format_name(cover)
-
     def test_cover_letter(self):
         """Cover letter name set as series name.
 
@@ -642,7 +638,7 @@  class SeriesNameTestCase(TestCase):
         mbox = self._get_mbox('base-cover-letter.mbox')
 
         cover = self._parse_mail(mbox[0])
-        cover_name = self._format_name(cover)
+        cover_name = 'A sample series'
         self.assertEqual(cover.series.first().name, cover_name)
 
         self._parse_mail(mbox[1])
@@ -697,7 +693,7 @@  class SeriesNameTestCase(TestCase):
         self.assertEqual(patch.series.first().name, patch.name)
 
         cover = self._parse_mail(mbox[2])
-        self.assertEqual(cover.series.first().name, self._format_name(cover))
+        self.assertEqual(cover.series.first().name, 'A sample series')
 
         mbox.close()