Unittesting Django on Google App Engine

105 views Asked by At

I have difficulty running django unit tests on GAE. I might be setting it up wrongly.

from django.test import TestCase
from django.test.utils import setup_test_environment
from django.test.client import Client

class Test_base(TestCase):

    def setUp(self):
        self.client = Client()
        # First, create an instance of the Testbed class.
        self.testbed = testbed.Testbed()
        # Then activate the testbed, which prepares the service stubs for use.
        self.testbed.activate()
        # Next, declare which service stubs you want to use.
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_mail_stub()
        self.testbed.init_memcache_stub()
        setup_test_environment()

    def tearDown(self):
        self.testbed.deactivate()


from test_base import Test_base
from nose.tools.trivial import eq_

class TestModels(Test_base):
    def test_shout_exists(self):
        eq_(1,2)

When running the test_shout_exists unit test, I get the following error message:

Finding files... done.
Importing test modules ... done.

Error: Couldn't install apps, because there were errors in one or more models:
django.contrib.contenttypes: 'module' object has no attribute 'messages'
django.contrib.messages: No module named messages
django.contrib.admin: 'module' object has no attribute 'messages'
django.contrib.auth: 'module' object has no attribute 'messages'
django.contrib.staticfiles: No module named staticfiles
django.contrib.sessions: 'module' object has no attribute 'messages'

Any hints? thanks

0

There are 0 answers