old_contents: from nose import tools as nt
  from django.test import SimpleTestCase
  
  from admin.spam.templatetags import spam_extras
  
  
  class TestReverseTags(SimpleTestCase):
      def test_reverse_spam_detail(self):
          res = spam_extras.reverse_spam_detail('123ab', page='2', status='4')
          nt.assert_in('/spam/123ab/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/123ab/?page=2&status=4'), len(res))
  
      def test_reverse_spam_list(self):
          res = spam_extras.reverse_spam_list(page='2', status='4')
          nt.assert_in('/spam/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/?page=2&status=4'), len(res))
  
      def test_reverse_spam_user(self):
          res = spam_extras.reverse_spam_user('kzzab', page='2', status='4')
          nt.assert_in('/spam/user/kzzab/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/user/kzzab/?page=2&status=4'),
                          len(res))
  
new_contents: from nose import tools as nt
  from django.test import SimpleTestCase
  from django.test.utils import override_settings
  
  from admin.spam.templatetags import spam_extras
  
  
  @override_settings(ROOT_URLCONF='admin.base.urls')
  class TestReverseTags(SimpleTestCase):
      def test_reverse_spam_detail(self):
          res = spam_extras.reverse_spam_detail('123ab', page='2', status='4')
          nt.assert_in('/spam/123ab/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/123ab/?page=2&status=4'), len(res))
  
      def test_reverse_spam_list(self):
          res = spam_extras.reverse_spam_list(page='2', status='4')
          nt.assert_in('/spam/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/?page=2&status=4'), len(res))
  
      def test_reverse_spam_user(self):
          res = spam_extras.reverse_spam_user('kzzab', page='2', status='4')
          nt.assert_in('/spam/user/kzzab/?', res)
          nt.assert_in('page=2', res)
          nt.assert_in('status=4', res)
          nt.assert_equal(len('/spam/user/kzzab/?page=2&status=4'),
                          len(res))
  
subject: Use proper URLconf in spam test_extras