Re: Problem with reversing url in test

2010-09-25 Thread Brandon Taylor
This problem turned out to be related to specificity. Another url
pattern was overriding the pattern that I was testing.

On Sep 24, 9:43 pm, Brandon Taylor  wrote:
> So it appears to be something with django-cms' urls that are causing
> issues with testing. I'm able to test any URL that isn't controlled by
> dajngo-cms, like '/admin/' or whatever.
>
> Anyone else using django-cms v2 and Django 1.1.1 experiencing these
> issues?
>
> TIA,
> Brandon
>
> On Sep 24, 6:40 am, Brandon Taylor  wrote:
>
> > So here's something else that's weird...
>
> > I can start a shell, load up the test Client and get the page in
> > question:
>
> > Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> > [GCC 4.4.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)>>> from django.test.client import Client
> > >>> c = Client()
> > >>> response = c.get('/categories/')
> > >>> response.status_code
>
> > 200
>
> > Anyone have any ideas what could be wrong with the unit test?
>
> > On Sep 23, 10:51 pm, Brandon Taylor  wrote:
>
> > > Hi everyone,
>
> > > I'm having a problem with reversing a URL in a unit test:
>
> > > class ProductTestCase(TestCase):
> > >     def setUp(self):
> > >         self.client = Client
>
> > >     def test_project_permalink(self):
> > >         project = Project.approved.all()[0]
> > >         url = project.get_absolute_url()
>
> > > I'm using an initial_data.json fixture that I exported from my current
> > > database, and I'm able to use the get_absolute_url method to navigate
> > > to a project detail page without error.
>
> > > When I try to reverse this url pattern in a test, I get a
> > > NoReverseMatch exception. django-cms is also running on my site, but
> > > disabling that app, and its url patterns doesn't make a difference.
>
> > > Anyone have any ideas on why this method would fail?
>
> > > TIA,
> > > Brandon
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with reversing url in test

2010-09-24 Thread Brandon Taylor
So it appears to be something with django-cms' urls that are causing
issues with testing. I'm able to test any URL that isn't controlled by
dajngo-cms, like '/admin/' or whatever.

Anyone else using django-cms v2 and Django 1.1.1 experiencing these
issues?

TIA,
Brandon

On Sep 24, 6:40 am, Brandon Taylor  wrote:
> So here's something else that's weird...
>
> I can start a shell, load up the test Client and get the page in
> question:
>
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)>>> from django.test.client import Client
> >>> c = Client()
> >>> response = c.get('/categories/')
> >>> response.status_code
>
> 200
>
> Anyone have any ideas what could be wrong with the unit test?
>
> On Sep 23, 10:51 pm, Brandon Taylor  wrote:
>
>
>
> > Hi everyone,
>
> > I'm having a problem with reversing a URL in a unit test:
>
> > class ProductTestCase(TestCase):
> >     def setUp(self):
> >         self.client = Client
>
> >     def test_project_permalink(self):
> >         project = Project.approved.all()[0]
> >         url = project.get_absolute_url()
>
> > I'm using an initial_data.json fixture that I exported from my current
> > database, and I'm able to use the get_absolute_url method to navigate
> > to a project detail page without error.
>
> > When I try to reverse this url pattern in a test, I get a
> > NoReverseMatch exception. django-cms is also running on my site, but
> > disabling that app, and its url patterns doesn't make a difference.
>
> > Anyone have any ideas on why this method would fail?
>
> > TIA,
> > Brandon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with reversing url in test

2010-09-24 Thread Brandon Taylor
So here's something else that's weird...

I can start a shell, load up the test Client and get the page in
question:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.test.client import Client
>>> c = Client()
>>> response = c.get('/categories/')
>>> response.status_code
200

Anyone have any ideas what could be wrong with the unit test?

On Sep 23, 10:51 pm, Brandon Taylor  wrote:
> Hi everyone,
>
> I'm having a problem with reversing a URL in a unit test:
>
> class ProductTestCase(TestCase):
>     def setUp(self):
>         self.client = Client
>
>     def test_project_permalink(self):
>         project = Project.approved.all()[0]
>         url = project.get_absolute_url()
>
> I'm using an initial_data.json fixture that I exported from my current
> database, and I'm able to use the get_absolute_url method to navigate
> to a project detail page without error.
>
> When I try to reverse this url pattern in a test, I get a
> NoReverseMatch exception. django-cms is also running on my site, but
> disabling that app, and its url patterns doesn't make a difference.
>
> Anyone have any ideas on why this method would fail?
>
> TIA,
> Brandon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problem with reversing url in test

2010-09-23 Thread Brandon Taylor
Hi everyone,

I'm having a problem with reversing a URL in a unit test:


class ProductTestCase(TestCase):
def setUp(self):
self.client = Client

def test_project_permalink(self):
project = Project.approved.all()[0]
url = project.get_absolute_url()


I'm using an initial_data.json fixture that I exported from my current
database, and I'm able to use the get_absolute_url method to navigate
to a project detail page without error.

When I try to reverse this url pattern in a test, I get a
NoReverseMatch exception. django-cms is also running on my site, but
disabling that app, and its url patterns doesn't make a difference.

Anyone have any ideas on why this method would fail?

TIA,
Brandon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.