last day (15 days later) » 

9:25 PM
0
Q: Django CMS test - can't find namespace

galozekI've got a very strange problem with Django CMS tests. When I run: ./manage.py test --settings=my_project.test_settings I get that error: ERROR: test_guest_list_view (apps.news.tests.test_views.NewsListViewTest) Tests if guest can't see disabled entries ---------------------------------...

 
I'm a little confused here. Are you testing an apphook? If so, you shouldn't have anything about that app in your urls.py, right?
 
@mkoistinen look at this: django-cms.readthedocs.org/en/latest/extending_cms/… - this is what I do. In my CMS that app is as an apphook, but in my tests I test that as normal app to check its functionality.
The problem is that when I run my all tests I get that error. When I run tests only for that particular app - it passes
 
What if instead of 'namespace' you used url(... app_name='news')
 
Fails, even in tests for that particular app.
 
Hmmm, I'm not sure what's up. I'm using namespaced apps all the time, and I normally just use namespace=.... which version of Django are you using?
Also, where is your apps.news.urls? Perhaps that is just not loading?
 
9:25 PM
Django==1.6.6, django-cms==3.0.5. My base app urls ale placed correctly in /news/ and my test urls are placed in /news/tests/ - testing that particular app works so I assume the app files are correct.
 
Can you prove that these urls are loading?
Perhaps we should continue this on IRC?
 
Hi
just converted that to a chat
Is that ok?
 
9:40 PM
OK.
 
Cool
Hi
 
Can you share your apps.news.urls?
 
I can prove that my test urls.py are triggered by putting syntax error there
sure
# -*- coding: utf-8 -*-
from django.conf.urls import *

from .views import NewsListView

urlpatterns = patterns(
'',
url(r'^$', NewsListView.as_view(), name="list"),
)
 
That only proves it cannot be parsed.
 
it's frst time I have that kind of problem, but can't find any mistake made by me :/
I have almost the same structure of tests and urls in different app in the same project
 
9:42 PM
What happens if you remove the ^ from the url patterns in this file?
 
and that works fine
 
So... we've fixed it?
 
no
it was second part of the sentence, sorry
so, you mean like that: url(r'$', NewsListView.as_view(), name="list"),
 
Yes.
 
NoReverseMatch: u'news' is not a registered namespace
 
9:44 PM
I'm doing this with normal django apps and it works great.
 
I did exactly the same with different app
in the same project and that works :/
maaybe the problem is, when 2 different apps use that urls overriding?
I checked if there are no same test cases names
all names are unique
also removed all .pyc
to be sure
 
Hmmm. I was just checking syntax. I once lost 3 hours on something similar because of a trailing comma, which made Django think it was dealing with a tuple. THAT was confusing...
Which version of Python?
 
2.7.6
 
Try a name other than 'list' for your url. Perhaps it has an issue with that.
BTW, the best place to get help is on IRC.
In the #django-cms channel.
Although, it has been mostly quiet lately.
 
hm, should I start there with pasting a link to stack overflow?
 
9:53 PM
No, we can continue here. I was just dropping that note in.
 
ok
so, I changed the namespace name, to be different than app name
also changed a list to listt
same error, no namespace :/
want to take a look at the all app?
news app
 
No, I'm actually terribly busy. I'm going to have to give up even. I think you should get on IRC and chat in the channel #django, cause this actually has nothing to do with the CMS AKAICT.
I mean AFAICT.
As far as I can tell.
 
OK, tahtks for your time
*thanks
 
Good luck, please do update your SO question with the solution when you find it.
 
Will surely do that
 

last day (15 days later) »