Conjunto de mudanças 6485 no repositório publico


Ignorar:
Timestamp:
13/06/2012 15:55:42 (9 anos atrás)
Autor:
mazza
Mensagem:

testes refatorados

Localização:
PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/tests
Arquivos:
1 adicionado
2 editados

Legenda:

Não Modificado
Adicionado
Removido
  • PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/tests/fixtures.py

    r6467 r6485  
    11# -*- coding: utf-8 -*-
    2 from persistent.dict import PersistentDict 
     2from persistent.dict import PersistentDict
    33from plone.app.testing import PLONE_FIXTURE, PloneSandboxLayer, IntegrationTesting, applyProfile
    44from z3c.form import datamanager
     
    88from zope.interface import implements
    99from zope.schema.interfaces import IField
    10 
     10from integrationtestutils import BrowserAwareIntegrationTesting
    1111
    1212class IlPortalinterlegis(PloneSandboxLayer):
     
    4444            implements(IDataManager)
    4545        provideAdapter(PersistentDictionaryField)
    46         # fim da POG 
     46        # fim da POG
    4747
    4848    def setUpPloneSite(self, portal):
    4949        applyProfile(portal, 'il.portalinterlegis:default')
    5050
     51
    5152IL_PORTALINTERLEGIS_FIXTURE = IlPortalinterlegis()
    5253IL_PORTALINTERLEGIS_INTEGRATION_TESTING = \
    53     IntegrationTesting(bases=(IL_PORTALINTERLEGIS_FIXTURE, ),
     54    BrowserAwareIntegrationTesting(bases=(IL_PORTALINTERLEGIS_FIXTURE, ),
    5455                       name="IlPortalinterlegis:Integration")
  • PortalInterlegis/produtos/il.portalinterlegis/trunk/src/il/portalinterlegis/tests/testintegration.py

    r6484 r6485  
    33import unittest2 as unittest
    44from Products.CMFCore.utils import getToolByName
     5from zExceptions import NotFound
     6
    57from fixtures import IL_PORTALINTERLEGIS_INTEGRATION_TESTING
    6 from plone.testing.z2 import Browser
    7 from zExceptions import NotFound
    8 from plone.app.testing import login, SITE_OWNER_NAME, SITE_OWNER_PASSWORD
    9 
    108from il.portalinterlegis.browser.boxes import BoxManager
    119from il.portalinterlegis.browser.interfaces import \
     
    2422
    2523    def new_browser(self, path=None, as_admin=False):
    26         browser = Browser(self.app)
    27         browser.handleErrors = False
    2824        if as_admin:
    29             browser.open(self.url("login_form"))
    30             browser.getControl(name='__ac_name').value = SITE_OWNER_NAME
    31             browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
    32             browser.getControl(name='submit').click()
     25            browser = self.layer.manager_browser()
     26        else:
     27            browser = self.layer.anonymous_browser()
    3328        browser.open(self.url(path))
    3429        return browser
     
    108103        with self.assertRaises(NotFound):
    109104            browser = self.new_browser(BoxManager(ISimpleBox)._box_name_for_url(99), as_admin=True)
    110 
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.