Thursday, July 29, 2010

Re: Using sqlite3 to test locally

I fixed this by commenting out 'django.contrib.auth' from
INSTALLED_APPS in settings.py

Also, to run doctests in PyDev for eclipse, all you need to do is go
to run configuration and add -v as an argument.
Then right click on the file with the doctest and run as 'Python Run'

Hope this helps anyone else with these problems.

On Jul 28, 12:43 pm, Zo <alonzo.j.benavi...@gmail.com> wrote:
> I had not, i ran it and created a superuser. should I be changing my
> setting file for my user info?
>
> I also changed DATABASE_ROUTERS = [] because it was previously set to
> ['test.ReportAdmin.routers.ReportAdminRouter']
>
> and I went back to
>
> DATABASES = {
>                 'default' : {
>                 'NAME' : 'C:/python-dev/pythonproject/test/sqlite3.db'
>                 ,'ENGINE' : 'django.db.backends.sqlite3'
>                 }
>
> }
>
> those changes caused my tests to actually run, but now I get lots of
> tests...
>
> ----------------------------------------------------------------------
> Ran 59 tests in 0.828s
>
> FAILED (failures=16, errors=4)
> Destroying test database 'default'...
>
> It looks like all failures come from Python26/lib/site-packages/django/
> contrib/auth/tests
>
> Here are a few of the errors/failures
>
> ======================================================================
> ERROR: test_no_remote_user
> (django.contrib.auth.tests.remote_user.RemoteUserCust
> omTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \remote_user.py",
>  line 33, in test_no_remote_user
>     self.assert_(response.context['user'].is_anonymous())
> TypeError: 'NoneType' object is unsubscriptable
>
> ======================================================================
> ERROR: test_no_remote_user
> (django.contrib.auth.tests.remote_user.RemoteUserNoCr
> eateTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \remote_user.py",
>  line 33, in test_no_remote_user
>     self.assert_(response.context['user'].is_anonymous())
> TypeError: 'NoneType' object is unsubscriptable
>
> ======================================================================
> ERROR: test_unknown_user
> (django.contrib.auth.tests.remote_user.RemoteUserNoCrea
> teTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \remote_user.py",
>  line 118, in test_unknown_user
>     self.assert_(response.context['user'].is_anonymous())
> TypeError: 'NoneType' object is unsubscriptable
>
> ======================================================================
> ERROR: test_no_remote_user
> (django.contrib.auth.tests.remote_user.RemoteUserTest
> )
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \remote_user.py",
>  line 33, in test_no_remote_user
>     self.assert_(response.context['user'].is_anonymous())
> TypeError: 'NoneType' object is unsubscriptable
>
> ======================================================================
> FAIL: test_password_change_fails_with_invalid_old_password
> (django.contrib.auth.
> tests.views.ChangePasswordTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \views.py", line
> 143, in test_password_change_fails_with_invalid_old_password
>     self.login()
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \views.py", line
> 127, in login
>     self.assertEquals(response.status_code, 302)
> AssertionError: 200 != 302
>
> ======================================================================
> FAIL: test_password_change_fails_with_mismatched_passwords
> (django.contrib.auth.
> tests.views.ChangePasswordTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \views.py", line
> 154, in test_password_change_fails_with_mismatched_passwords
>     self.login()
>   File "C:\Python26\lib\site-packages\django\contrib\auth\tests
> \views.py", line
> 127, in login
>     self.assertEquals(response.status_code, 302)
>
> Can i disable these or should all these be passing?
>
> Thanks,
> Zo
>
> On Jul 28, 12:20 pm, Shawn Milochik <sh...@milochik.com> wrote:
>
> > Did you run ./manage.py syncdb?

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

No comments:

Post a Comment