Ask Your Question

Haystack test 'test_user_profile_search' fails

asked 2013-09-28 05:44:02 -0600

apg gravatar image

updated 2013-09-28 18:33:52 -0600

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-28 22:01:18 -0600

Evgeny gravatar image

Thank you, applied your suggestion in the repository.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-09-28 05:44:02 -0600

Seen: 101 times

Last updated: Sep 28 '13