kmpekala / django-forum

Automatically exported from code.google.com/p/django-forum
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Django unit test - Url testing #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am want to write django 1.1 test case on fedora 12 x86_64.
To test the url I want to session to be persistent so that the next
test can use the same context. I can use client.login() method becoz
in the application login is rewritten.

If I directly use
kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}
response = self.client.post('/login/', {'username': 't...@test.com',
'password': 'test01', 'domain':'demo1'}, **kwargs)
This works fine but I am not able to test the next url. It's trowing
following error
WARNING:root:Caught an exception while processing permission:
{'content': 'MSHTML', 'name': 'GENERATOR', 'group_name': ''}
ERROR:root:Permission matching query does not exist.
Traceback (most recent call last):
  File "/home/sungard/Portals/trunk/django/portal/../portal/auth.py",
line 143, in authenticate
    perm = Permission.objects.get(codename = codename)
  File "/usr/lib/python2.6/site-packages/django/db/models/manager.py",
line 120, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/django/db/models/query.py",
line 305, in get
    % self.model._meta.object_name)
DoesNotExist: Permission matching query does not exist.

Please suggest. 

Original issue reported on code.google.com by Pradnya....@gmail.com on 14 Jul 2010 at 8:04

GoogleCodeExporter commented 8 years ago
You can search on Google with this issue google give good result regarding want 
to develop application one of good company for Django development that is  
LeoTechnoSoft.net

Original comment by kr.krist...@gmail.com on 7 Aug 2013 at 2:35