First time here? Check out the FAQ!

Haystack test 'test_user_profile_search' fails

Could someone take a look at this test failure?

I get the following failure:

/home/a/virtualenv/4hou4ken/bin/python2.7 /media/sf_Ubuntu/4hou4ken/forum/ test askbot.HaystackSearchTests WARNING!!! You are using a 'locmem' (local memory) caching backend, which is OK for a low volume site running on a single-process server. For a multi-process configuration it is neccessary to have a production cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently see outdated content on your site.

Creating test database for alias 'default'... ...F ====================================================================== FAIL: test_user_profile_search (askbot.tests.haystack_search_tests.HaystackSearchTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/tests/", line 84, in test_user_profile_search self.assertEquals(user_profile_qs.count(), 1) AssertionError: 0 != 1

---------------------------------------------------------------------- Ran 4 tests in 17.870s

FAILED (failures=1) Destroying test database for alias 'default'...

Process finished with exit code 1

As I judge from the Solr Admin, "wood" is not index because querying for "wood" returns no record of it. For this reason, I am suspecting this may be caused by schema.xml being improperly configured. Thank you.


I am guessing the above failure may be caused by the following code in askbot/search/haystack/ because Django's User class does not have location or about field.

def get_model(self): from askbot.models import User return User

I tried to extend the User class in askbot/models/ So far, it is unsuccessful because I got errors such as

askbot.activity: 'user' has a relation with model <class 'askbot.models.user.user'="">, which has either not been installed or is abstract.</class>

Update2: Maybe solved?

It turned out adding the following two lines to


made the test to pass

{{ object.about }}

{{ object.location }}

{{}} may be added too. But, I am not sure on this because this may index country even if show_country is false.

apg's avatar
asked 2013-09-28 05:44:02 -0500, updated 2013-09-28 18:33:52 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


Thank you, applied your suggestion in the repository.

Evgeny's avatar
answered 2013-09-28 22:01:18 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments