  def make_function(input, toks):
      def test_func(self):
          lexer = JsLexer()
          result = ["%s %s" % (name, tok) for name, tok in lexer.lex(input) if name != 'ws']
          self.assertListEqual(result, toks)
      return test_func
  
  
  for i, (input, toks) in enumerate(JsTokensTest.LEX_CASES):
      setattr(JsTokensTest, "test_case_%d" % i, make_function(input, toks))
 
</s> remove         self.assertMultiLineEqual(prepare_js_for_gettext(js), c)
 </s> add         self.assertEqual(prepare_js_for_gettext(js), c) </s> remove         self.assertListEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter'])
 </s> add         self.assertEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter']) </s> remove         self.assertSetEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u1})
        self.assertSetEqual({p.ewkt for p in ref_u2}, {p.ewkt for p in u2})
        self.assertSetEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u3})
 </s> add         self.assertEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u1})
        self.assertEqual({p.ewkt for p in ref_u2}, {p.ewkt for p in u2})
        self.assertEqual({p.ewkt for p in ref_u1}, {p.ewkt for p in u3}) </s> remove         self.assertListEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter'])
 </s> add         self.assertEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter']) </s> remove         self.assertListEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter'])
 </s> add         self.assertEqual([r.__class__.__name__ for r in connection_router.routers], ['TestRouter', 'WriteRouter'])
        self.assertEqual(result, toks)
  def make_function(input, toks):
      def test_func(self):
          lexer = JsLexer()
          result = ["%s %s" % (name, tok) for name, tok in lexer.lex(input) if name != 'ws']
        self.assertEqual(result, toks)
      return test_func
  
  
  for i, (input, toks) in enumerate(JsTokensTest.LEX_CASES):
      setattr(JsTokensTest, "test_case_%d" % i, make_function(input, toks))
keep keep keep keep replace keep keep keep keep keep
 Replaced type-specific assertions with assertEqual().

Python docs say, "it's usually not necessary to invoke these methods directly." 
tests/utils_tests/test_jslex.py