Changeset 475 in main


Ignore:
Timestamp:
11/14/11 16:27:20 (8 years ago)
Author:
pcosquer
Message:

tests: csvimport: rebuild the search index and disconnect the task_prerun signal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/tests/csvimport.py

    r474 r475  
    99from django.contrib.auth.models import User 
    1010from django.test import TransactionTestCase 
     11from django.core.management import call_command 
    1112 
    1213from celery.signals import task_prerun 
     
    4344        self.user.groups.add(self.group) 
    4445        self.client.post("/login/", {'username' : 'user', 'password' : 'password'}) 
    45         self.handler = task_prerun.connect(self.task_sent_handler) 
     46        task_prerun.connect(self.task_sent_handler) 
     47        call_command("rebuild_index", interactive=False, verbosity=0) 
    4648 
    4749    def task_sent_handler(self, sender=None, task_id=None, task=None, args=None, 
     
    5153    def tearDown(self): 
    5254        super(CSVImportTestCase, self).tearDown() 
    53         task_prerun.disconnect(self.handler) 
     55        task_prerun.disconnect(self.task_sent_handler) 
    5456        if os.path.exists(settings.HAYSTACK_XAPIAN_PATH): 
    5557            shutil.rmtree(settings.HAYSTACK_XAPIAN_PATH) 
Note: See TracChangeset for help on using the changeset viewer.