Exemplo n.º 1
0
    def setUp(self):
        delete_index()
        create_index()

        self.category = CategoryFactory()
        put_category_mapping(self.category.id)
        user = UserFactory(email='*****@*****.**', password='******',
                           is_superuser=True,
                           category=self.category)

        connect_signals()
        for doc_id in xrange(20):
            doc = DocumentFactory(
                document_key='hazop-report-%d' % doc_id,
                category=self.category,
            )
            index_document(doc.id)

        # ES needs some time to finish indexing
        time.sleep(1)

        document_list_url = reverse('category_document_list', args=[
            self.category.organisation.slug,
            self.category.slug
        ])
        self.url = '%s%s' % (self.live_server_url, document_list_url)
        self.client.login(email=user.email, password='******')
        self.test_file = os.path.join(
            os.path.dirname(__file__),
            'casper_tests',
            'tests.js'
        )
Exemplo n.º 2
0
    def setUp(self):
        delete_index()
        create_index()

        self.category = CategoryFactory()
        put_category_mapping(self.category.id)
        user = UserFactory(email='*****@*****.**', password='******',
                           is_superuser=True,
                           category=self.category)

        connect_signals()
        for doc_id in range(20):
            doc = DocumentFactory(
                document_key='hazop-report-%d' % doc_id,
                category=self.category,
            )
            index_document(doc.id)

        # ES needs some time to finish indexing
        time.sleep(1)

        document_list_url = reverse('category_document_list', args=[
            self.category.organisation.slug,
            self.category.slug
        ])
        self.url = '%s%s' % (self.live_server_url, document_list_url)
        self.client.login(email=user.email, password='******')
        self.test_file = os.path.join(
            os.path.dirname(__file__),
            'casper_tests',
            'tests.js'
        )
Exemplo n.º 3
0
    def setUp(self):
        self.category = CategoryFactory()
        user = UserFactory(
            email='*****@*****.**',
            password='******',
            is_superuser=True,
            category=self.category,
        )
        self.client.login(email=user.email, password='******')

        # Since test settings disable auto indexing, we need to
        # manually connect the signal here
        connect_signals()
        call_command('delete_index')
        call_command('create_index')
        call_command('set_mappings')
Exemplo n.º 4
0
    def setUp(self):
        self.category = CategoryFactory()
        user = UserFactory(
            email='*****@*****.**',
            password='******',
            is_superuser=True,
            category=self.category,
        )
        self.client.login(email=user.email, password='******')

        # Since test settings disable auto indexing, we need to
        # manually connect the signal here
        connect_signals()
        call_command('delete_index')
        call_command('create_index')
        call_command('set_mappings')
Exemplo n.º 5
0
    def setUp(self):
        delete_index()
        create_index()

        self.category = CategoryFactory()
        self.slug = '/{}/{}/'.format(
            self.category.organisation.slug,
            self.category.category_template.slug)
        put_category_mapping(self.category.id)
        user = UserFactory(email='*****@*****.**', password='******',
                           is_superuser=True,
                           category=self.category)

        connect_signals()
        for doc_id in xrange(20):
            DocumentFactory(
                document_key='hazop-report-%d' % doc_id,
                category=self.category,
            )

        document_list_url = reverse('category_document_list', args=[
            self.category.organisation.slug,
            self.category.slug
        ])

        self.b1 = BookmarkFactory(
            user=user,
            category=self.category,
            name='Hazop documents',
            url='%s?search_terms=hazop' % document_list_url
        )
        self.b2 = BookmarkFactory(
            user=user,
            category=self.category,
            name='Rev ordered documents',
            url='%s?sort_by=current_revision' % document_list_url
        )

        self.url = '%s%s' % (self.live_server_url, document_list_url)
        self.client.login(email=user.email, password='******')
        self.test_file = os.path.join(
            os.path.dirname(__file__),
            'casper_tests',
            'tests.js'
        )
Exemplo n.º 6
0
    def setUp(self):
        delete_index()
        create_index()

        self.category = CategoryFactory()
        self.slug = '/{}/{}/'.format(
            self.category.organisation.slug,
            self.category.category_template.slug)
        put_category_mapping(self.category.id)
        user = UserFactory(email='*****@*****.**', password='******',
                           is_superuser=True,
                           category=self.category)

        connect_signals()
        for doc_id in range(20):
            DocumentFactory(
                document_key='hazop-report-%d' % doc_id,
                category=self.category,
            )

        document_list_url = reverse('category_document_list', args=[
            self.category.organisation.slug,
            self.category.slug
        ])

        self.b1 = BookmarkFactory(
            user=user,
            category=self.category,
            name='Hazop documents',
            url='%s?search_terms=hazop' % document_list_url
        )
        self.b2 = BookmarkFactory(
            user=user,
            category=self.category,
            name='Rev ordered documents',
            url='%s?sort_by=current_revision' % document_list_url
        )

        self.url = '%s%s' % (self.live_server_url, document_list_url)
        self.client.login(email=user.email, password='******')
        self.test_file = os.path.join(
            os.path.dirname(__file__),
            'casper_tests',
            'tests.js'
        )