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

Stephen Finucane stephen at that.guru
Sat Sep 22 03:51:02 AEST 2018


Compare against known values to ensure bugs introduced in the function
are caught.

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

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()
 
-- 
2.17.1



More information about the Patchwork mailing list