title: How to use Django reverse in tests?
body: <p>I don't know how to use the reverse function in django.I am getting this,</p>
  
  <pre><code>ValueError: dictionary update sequence element #0 has length 1; 2 is required
  </code></pre>
  
  <p>I could hardcode the urls directly that worked fine, but i wanted to do it in standard way.</p>
  
  <p><strong>main urls.py</strong></p>
  
  <pre><code> urlpatterns = [
              url(r'^nmailadmin/', admin.site.urls),
              url(r'^api/v1/',include('Core.Login.urls',namespace='login')),
              url(r'^api/v1/mail/',include('Core.Mail.urls',namespace='mail')),
   ]
  </code></pre>
  
  <p>I have given namespace for login and mail API.</p>
  
  <p>When I try to access  mail urls like this</p>
  
  <pre><code>def test_0list_folders(self):
      url = reverse('mail:folder_list', kwargs={'server':0})
      response = self.client.get('/api/v1/mail/folder_list/0/', follow=True)
      self.assertEqual(status.HTTP_200_OK, response.status_code)
  </code></pre>
  
  <p>I am getting error like this.</p>
  
  <pre><code>----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/next/PycharmProjects/Nmail/Nmail-Server/Core/Mail/tests.py", line 25, in test_0list_folders
      url = reverse('mail:folder_list', kwargs={'server':0})
    File "/home/next/venv/NmailVenv/lib/python3.6/site-packages/django/urls/base.py", line 91, in reverse
      return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
    File "/home/next/venv/NmailVenv/lib/python3.6/site-packages/django/urls/resolvers.py", line 436, in _reverse_with_prefix
      self._populate()
    File "/home/next/venv/NmailVenv/lib/python3.6/site-packages/django/urls/resolvers.py", line 309, in _populate
      dict(defaults, **pattern.default_kwargs),
  ValueError: dictionary update sequence element #0 has length 1; 2 is required
  
  ----------------------------------------------------------------------
  </code></pre>
  
  <p>This is my urls file of mail app.</p>
  
  <pre><code>urlpatterns = [
     url(r'folder_list/(?P&lt;server&gt;\d+)/$', folder_list,name='folder_list'),
     url(r'^auth_login/$', login_auth, name='auth_login'),
     url(r'viewmsg/(?P&lt;server&gt;\d+)/(?P&lt;folder&gt;.*?)/(?P&lt;uid&gt;\d+)/$', viewmsg, name='viewmsg'),
      url(r'action/(?P&lt;action&gt;.*?)/$', action, 'action'),
       ]
  </code></pre>
  
  <p><strong>Django version : Django==1.11.7</strong></p>