Beispiel #1
0
    def setUp(self):
        super(SearchModelAdminTestCase, self).setUp()

        # With the models registered, you get the proper bits.
        import haystack
        from haystack.sites import SearchSite

        # Stow.
        self.old_debug = settings.DEBUG
        settings.DEBUG = True
        self.old_site = haystack.site
        test_site = SearchSite()
        test_site.register(MockModel, SolrMockModelSearchIndex)
        haystack.site = test_site

        # Wipe it clean.
        clear_solr_index()

        # Force indexing of the content.
        mockmodel_index = test_site.get_index(MockModel)
        mockmodel_index.update()

        superuser = User.objects.create_superuser(
            username='******',
            password='******',
            email='*****@*****.**',
        )
Beispiel #2
0
 def setUp(self):
     super(SearchModelAdminTestCase, self).setUp()
     
     # With the models registered, you get the proper bits.
     import haystack
     from haystack.sites import SearchSite
     
     # Stow.
     self.old_debug = settings.DEBUG
     settings.DEBUG = True
     self.old_site = haystack.site
     test_site = SearchSite()
     test_site.register(MockModel, SolrMockModelSearchIndex)
     haystack.site = test_site
     
     # Wipe it clean.
     clear_solr_index()
     
     # Force indexing of the content.
     mockmodel_index = test_site.get_index(MockModel)
     mockmodel_index.update()
     
     superuser = User.objects.create_superuser(
         username='******',
         password='******',
         email='*****@*****.**',
     )
Beispiel #3
0
    def setUp(self):
        super(MoreLikeThisTagTestCase, self).setUp()

        clear_solr_index()

        # Stow.
        self.old_ui = connections['default'].get_unified_index()
        self.ui = UnifiedIndex()
        self.smmi = MLTSearchIndex()
        self.ui.build(indexes=[self.smmi])
        connections['default']._index = self.ui

        # Force indexing of the content.
        for mock in MockModel.objects.all():
            mock.save()
    def setUp(self):
        super(MoreLikeThisTagTestCase, self).setUp()

        clear_solr_index()

        # Stow.
        self.old_ui = connections['default'].get_unified_index()
        self.ui = UnifiedIndex()
        self.smmi = MLTSearchIndex()
        self.ui.build(indexes=[self.smmi])
        connections['default']._index = self.ui

        # Force indexing of the content.
        for mock in MockModel.objects.all():
            mock.save()
Beispiel #5
0
    def setUp(self):
        super(SearchModelAdminTestCase, self).setUp()

        # With the models setup, you get the proper bits.
        # Stow.
        self.old_debug = settings.DEBUG
        settings.DEBUG = True
        self.old_ui = connections["default"].get_unified_index()
        self.ui = UnifiedIndex()
        smmsi = SolrMockModelSearchIndex()
        self.ui.build(indexes=[smmsi])
        connections["default"]._index = self.ui

        # Wipe it clean.
        clear_solr_index()

        # Force indexing of the content.
        smmsi.update()

        superuser = User.objects.create_superuser(username="******", password="******", email="*****@*****.**")
Beispiel #6
0
    def setUp(self):
        super(SearchModelAdminTestCase, self).setUp()

        # With the models setup, you get the proper bits.
        # Stow.
        self.old_debug = settings.DEBUG
        settings.DEBUG = True
        self.old_ui = connections['default'].get_unified_index()
        self.ui = UnifiedIndex()
        smmsi = SolrMockModelSearchIndex()
        self.ui.build(indexes=[smmsi])
        connections['default']._index = self.ui

        # Wipe it clean.
        clear_solr_index()

        # Force indexing of the content.
        smmsi.update()

        superuser = User.objects.create_superuser(
            username='******',
            password='******',
            email='*****@*****.**',
        )