Found the answer:
I need to put from tests import * in the tests/__init__.py file
> Actually, Django TestCases can override the URLConf, which allows you to have
> a given URL for a given view in your test:
>
> from django.test import TestCase
>
> class MyTestCase(TestCase):
> urls =
Thanks you for your help.
I understand now how I should setup testing for a django package. I'm using
django-registration as an example , which works a similar way.
I have a weird problem at hand.
I'm creating a django package and would like to provide some test cases for it.
The package is
Actually, Django TestCases can override the URLConf, which allows you to
have a given URL for a given view in your test:
from django.test import TestCase
class MyTestCase(TestCase):
urls = 'mypackage.tests.urls'
def test_something():
# Do stuff...
>From there, you can
> I think you could create an urls.py file for your tests and attach
> your views there. Then use the test client to direct requests to those
> test URLs and assert that the response is what you expect.
I didn't know that could work.
I think I'll also need to create views that extend these
I think you could create an urls.py file for your tests and attach
your views there. Then use the test client to direct requests to those
test URLs and assert that the response is what you expect.
Now, this is probably not going to be practical to test your jQuery
components, but you might want
I can now show you what I really would like to write tests for.
https://github.com/jonasgeiregat/django-ajax-forms
The code I would like to test is in ajax_forms/views.py mainly the AjaxFormView
and the AjaxModelFormView.
Any help is appreciated!
>
>> Is it a view mix in?
>>
> The package
> Is it a view mix in?
>
The package actually already changed from containing a view mix in to actual
views that should be subclassed by the users using the package.
> It's a bit difficult to tell you much without more information.
>
For example, a view derived from FormView. Like I said the
Is it a view mix in?
It's a bit difficult to tell you much without more information.
A few you things that you may find useful or not for testing :
. Test cases can override settings such as the urlconf
. There's a test client to test views
. Class based views can sometimes be tested without
8 matches
Mail list logo