Example #1
0
 def setUp(self):
   #self.mock = Mocker()
   #MEMBER = self.mock.mock()
   
   log.model.LOG = {}            
   log.model.NEWS = {}
   evaluation.model.EVALUATION = EVALUATION_DEFAULT()
   evaluation.model.EVALUATIONCOMMUNITY = EVALUATION_COMMUNITY_DEFAULT()
   core.model.REGISTRY = {}
   core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
   core.model.INVITES = {}
   core.model.USERSCHOOL = {}    
   #core.model.MAGKEYTYPES = {}
   log.model.NOTIFICATIONERROR = {}
   log.model.NOTIFICATION = {}
   
   self.app = TestApp(WsgiApp())
   login.update(LOGIN_FORM)
   #core.model.REGISTRY['teste']['papeis'].append('docente')
   registry.update(REGISTRY_FORM)
   
   self.app.post('/new/user', registry)
   registry['user'] = '******'
   core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
   self.app.post('/new/user', registry)      
   registry['user'] = '******'
   core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
   self.app.post('/new/user', registry)      
   self.app.post('/login', login)
   create_community.update(CREATE_COMMUNITY_FORM)
   core.model.REGISTRY['teste']['papeis'].append('docente')
   self.app.post('/new/community', create_community)
   create_evaluation.update(CREATE_EVALUATION_FORM())
   perform_evaluation.update(PERFORM_EVALUATION_FORM())
Example #2
0
 def setUp(self):
   #self.mock = Mocker()
   #REGISTRY = self.mock.mock()
   
   core.model.REGISTRY = {}
   core.model.MAGKEYS = MAGKEYS_DEFAULT()
   core.model.INVITES = {}
   core.model.MAGKEYTYPES = {}
   core.model.USERSCHOOL = {}
   search.model.SEARCHTAGS = {}
   wiki.model.WIKI = WIKI_DEFAULT()
   wiki.model.WIKIMEMBER = {}
   wiki.model.WIKICOMMUNITY = WIKICOMMUNITY_DEFAULT()
   wiki.model.FILES = {}
   log.model.LOG = {}
   log.model.NEWS = {}
   log.model.NOTIFICATIONERROR = {}
   log.model.NOTIFICATION = {}
   
   self.app = TestApp(WsgiApp())
   registry.update(REGISTRY_FORM)
   login.update(LOGIN_FORM)
   mkeys.update(MAGKEYS_FORM)
   changepasswd.update(CHANGE_PASSWD_FORM)
   profile_edit.update(PROFILE_EDIT)
   invite.update(INVITE_FORM)
Example #3
0
    def setUp(self):
        # self.mock = Mocker()
        # MEMBER = self.mock.mock()

        core.model.REGISTRY = {}
        core.model.MAGKEYS = MAGKEYS_DEFAULT()  # recria chave mágica para que possa fazer outro cadastro
        core.model.INVITES = {}
        core.model.MAGKEYTYPES = {}
        core.model.USERSCHOOL = {}

        log.model.LOG = {}
        log.model.NEWS = {}
        wiki.model.WIKI = {}
        wiki.model.WIKIMEMBER = {}
        wiki.model.WIKICOMMUNITY = {}
        log.model.NOTIFICATIONERROR = {}
        log.model.NOTIFICATION = {}

        self.app = TestApp(WsgiApp())
        registry.update(REGISTRY_FORM)
        self.app.post("/new/user", registry)
        registry["user"] = "******"
        core.model.MAGKEYS = MAGKEYS_DEFAULT()  # recria chave mágica para que possa fazer outro cadastro

        self.app.post("/new/user", registry)
        login.update(LOGIN_FORM)
        self.app.post("/login", login)
Example #4
0
 def setUp(self):
    
    log.model.LOG = {}            
    log.model.NEWS = {}
    model.AGENDA = {}
    core.model.REGISTRY = {}
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    core.model.INVITES = {}
    core.model.USERSCHOOL = {}    
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}      
    #core.model.MAGKEYTYPES = {}
    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)
    self.app.post('/new/user', registry)
    login.update(LOGIN_FORM)
    self.app.post('/login', login)
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    community.update(COMMUNITY_FORM)
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro
    core.model.REGISTRY['teste']['papeis'].append('docente')
    
    self.app.post('/new/community', community)
    #assert False, core.model.REGISTRY['comunidade1']
    agenda1.update(AGENDA_FORM1)
    agenda_alterada.update(AGENDA_ALTERADA1)
Example #5
0
   def setUp(self):
      #self.mock = Mocker()
      #MEMBER = self.mock.mock()

      log.model.LOG = {}            
      log.model.NEWS = {}
      model.MBLOG = MBLOG_DEFAULT()
      model.REGISTRYMBLOG = REGISTRYMBLOG_DEFAULT()
      model.REGISTRYMBLOGOWNERS = REGISTRYMBLOGOWNERS_DEFAULT()
      wiki.model.WIKI = {}
      wiki.model.WIKIMEMBER = {}
      wiki.model.WIKICOMMUNITY = {}      
      core.model.REGISTRY = REGISTRY_DEFAULT()
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      core.model.INVITES = {}
      core.model.MAGKEYTYPES = {}
      core.model.USERSCHOOL = {}    
      log.model.NOTIFICATIONERROR = {}
      log.model.NOTIFICATION = {}
    
      self.app = TestApp(WsgiApp())
      login.update(LOGIN_FORM)
      registry.update(REGISTRY_FORM)
      self.app.post('/new/user', registry)
      core.model.REGISTRY['teste']['papeis'].append('professor')
      #assert False, core.model.REGISTRY['teste']
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)      
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)      
      self.app.post('/login', login)
Example #6
0
 def setUp(self):
    
    log.model.LOG = {}            
    log.model.NEWS = {}
    model.AGENDA = {}
    core.model.REGISTRY = PRIVILEGIOS_DEFAULT()
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    core.model.INVITES = {}
    core.model.USERSCHOOL = {}    
    educo_core.model.ALLOWED_USERS = ALLOWED_USERS_DEFAULT()
    educo_core.model.CADERNOS      = {}
    educo_core.model.ATIVIDADES    = {}
    educo_core.model.ACESSOS       = {}
    educo_core.model.SLIDES        = {}
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
  
    self.app = TestApp(WsgiApp())
    
    # registra usuário "teste"
    registry.update(REGISTRY_FORM)
    self.app.post('/new/user', registry)
    core.model.REGISTRY["teste"]["comunidades"] = ["Priv_Suporte_Educopedia", "PRIV_SUPORTE_ACTIV"]
    # registra usuário "teste2"
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    
    # faz login como teste
    login.update(LOGIN_FORM)
    self.app.post('/login', login)
Example #7
0
  def setUp(self):
    #self.mock = Mocker()
    #MEMBER = self.mock.mock()
    
    core.model.REGISTRY = {}
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    core.model.INVITES = {}
    core.model.MAGKEYTYPES = {}
    core.model.USERSCHOOL = {}
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
    
    log.model.LOG = {}
    log.model.NEWS = {}
    wiki.model.WIKI = {}
    wiki.model.WIKIMEMBER = {}
    wiki.model.WIKICOMMUNITY = {}      
    scrapbook.model.SCRAPBOOK = {}
    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)
    self.app.post('/new/user', registry)
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)

    login.update(LOGIN_FORM)
    self.app.post('/login', login)
    send_scrap.update(SEND_SCRAP_FORM)
Example #8
0
   def setUp(self):
      #self.mock = Mocker()
      #MEMBER = self.mock.mock()

      log.model.LOG = {}            
      log.model.NEWS = {}
      model.FILE = FILES_DEFAULT()
      model.REGISTRYFILE = FILEREGISTRY_DEFAULT()
      core.model.REGISTRY = REGISTRY_DEFAULT()
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro
      core.model.INVITES = {}
      core.model.MAGKEYTYPES = {}
      core.model.USERSCHOOL = {}
      
      search.model.SEARCHTAGS = {}  
      log.model.NOTIFICATIONERROR = {}
      log.model.NOTIFICATION = {}
    
      self.app = TestApp(WsgiApp())
      login.update(LOGIN_FORM)
      registry.update(REGISTRY_FORM)
      self.app.post('/new/user', registry)
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)         
      self.app.post('/login', login)
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
Example #9
0
   def setUp(self):
      #self.mock = Mocker()
      #MEMBER = self.mock.mock()

      log.model.LOG = {}            
      log.model.NEWS = {}
      model.WIKI = WIKI_DEFAULT()
      model.REGISTRYWIKI = REGISTRYWIKI_DEFAULT()
      core.model.REGISTRY = REGISTRY_DEFAULT()
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro
      core.model.INVITES = {}
      core.model.MAGKEYTYPES = {}
      core.model.USERSCHOOL = {}
      
      search.model.SEARCHTAGS = {}  
      log.model.NOTIFICATIONERROR = {}
      log.model.NOTIFICATION = {}
    
      self.app = TestApp(WsgiApp())
      pagina.update(WIKI_FORM())
      pagina_alterada.update(WIKI_FORM_ALTERADO())      
      pagina_alterada_outro_usu.update(WIKI_FORM_ALTERADO_OUTRO_USUARIO())      
      login.update(LOGIN_FORM)
      registry.update(REGISTRY_FORM)
      self.app.post('/new/user', registry)
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)
      registry['user'] = '******'
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
      self.app.post('/new/user', registry)         
      self.app.post('/login', login)
      core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
Example #10
0
  def setUp(self):
    #core.model.REGISTRY = {}
    #core.model.PROFESSOR = {}
    #core.model.MAGKEYS = {}
    #core.model.REGISTRY = {}
    #core.model.USERSCHOOL = {}    
    #wiki.model.WIKI = {}
    #wiki.model.WIKIMEMBER = {}
    #wiki.model.WIKICOMMUNITY = {}  
    #wiki.model.FILES = {}
    #log.model.LOG = {}
    #log.model.NEWS = {}

    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)
    
    #login.update(LOGIN_FORM)
    pagina = WIKI_FORM()
    community = CREATE_COMMUNITY_FORM()
    
    "Faz login como admin para criar uma comunidade"
    login.update(LOGIN_FORM)
    login["user"] =   '******'
    login["passwd"] = '123456'
    response = self.app.post('/login', login).follow().follow()
            
    "Cria uma comunidade teste onde os usuários serão inseridos por default"
    response = self.app.post('/new/community', community) 
Example #11
0
 def setUp(self):
    #self.mock = Mocker()
    #MEMBER = self.mock.mock()
    
    log.model.LOG = {}            
    log.model.NEWS = {}
    model.BLOG = BLOG_DEFAULT()
    model.REGISTRYBLOG = REGISTRYBLOG_DEFAULT()
    model.COMMENT = COMMENT_DEFAULT()
    model.POSTCOMMENTS = POSTCOMMENTS_DEFAULT()
    search.model.SEARCHTAGS = {}
    wiki.model.WIKI = {}
    wiki.model.WIKIMEMBER = {}
    wiki.model.WIKICOMMUNITY = {}      
    core.model.REGISTRY = REGISTRY_DEFAULT
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro    
    core.model.INVITES = {}
    core.model.MAGKEYTYPES = {}
    core.model.USERSCHOOL = {}    
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
  
    self.app = TestApp(WsgiApp())
    login.update(LOGIN_FORM)
    registry.update(REGISTRY_FORM)
    self.app.post('/new/user', registry)
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro    
    self.app.post('/new/user', registry)      
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro    
    self.app.post('/new/user', registry)
    self.app.post('/login', login)   
Example #12
0
  def setUp(self):
    #self.mock = Mocker()
    #MEMBER = self.mock.mock()
    
    core.model.REGISTRY = REGISTRY_DEFAULT()
    wiki.model.WIKI = {}
    wiki.model.WIKIMEMBER = {}
    wiki.model.WIKICOMMUNITY = {}      
    wiki.model.FILES = {}
    core.model.MAGKEYS = MAGKEYS_DEFAULT()
    core.model.INVITES = {}
    core.model.USERSCHOOL = {}    
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
    
    #core.model.MAGKEYTYPES = {}
    #core.model.MAGKEYINSTITUTES = {}
    core.model.USERSCHOOL = {}
    log.model.LOG = {}
    log.model.NEWS = {}
    
    invite.update(COMMUNITY_INVITE)
    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)

    # Cria usuários para os testes
    #registry['user'] = '******'
    self.app.post('/new/user', registry)
    core.model.REGISTRY['teste']['cod_institute'] = u"0002"
     
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    core.model.REGISTRY['userpub']['cod_institute'] = u'0002'
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    core.model.REGISTRY['userpriv']['privacidade'] = "Privada"
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro    
    self.app.post('/new/user', registry)
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro    
    self.app.post('/new/user', registry)
    
    # Faz login como usuário teste
    login.update(LOGIN_FORM)
    self.app.post('/login', login)
    core.model.REGISTRY['teste']['papeis'].append('docente')
    create_community.update(CREATE_COMMUNITY_FORM)
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro
Example #13
0
  def setUp(self):
    #self.mock = Mocker()
    #MEMBER = self.mock.mock()
    
    core.model.REGISTRY = REGISTRY_DEFAULT()
    core.model.MAGKEYS = MAGKEYS_DEFAULT()
    core.model.INVITES = {}
    core.model.USERSCHOOL = {}    
    core.model.MAGKEYTYPES = {}
    core.model.MAGKEYINSTITUTES = {}

    wiki.model.WIKI = {}
    wiki.model.WIKIMEMBER = {}
    wiki.model.WIKICOMMUNITY = {}      
    wiki.model.FILES = {}
    forum.model.FORUM = FORUM_DEFAULT()
    log.model.LOG = {}
    log.model.NEWS = {}
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)

    # Cria usuários para os testes
    #registry['user'] = '******'
    self.app.post('/new/user', registry)
    core.model.REGISTRY['teste']['cod_institute'] = u"0002"
     
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    core.model.REGISTRY['userteste']['cod_institute'] = u'0002'
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    core.model.REGISTRY['usercomum']['cod_institute'] = u'0002'    
    
    registry['user'] = '******'
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro  
    self.app.post('/new/user', registry)
    core.model.REGISTRY['usercomum']['cod_institute'] = u'0002'
    
    # Faz login como usuário teste
    login.update(LOGIN_FORM)
    self.app.post('/login', login)
    core.model.REGISTRY['teste']['papeis'].append('professor')

    create_topic.update(CREATE_TOPIC_FORM)
    create_post.update(CREATE_POST_FORM)
    create_search.update(CREATE_SEARCH_FORM)
    create_config.update(CREATE_CONFIG_FORM)
    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro
Example #14
0
 def setUp(self):
   #core.model.REGISTRY = {}
   #core.model.PROFESSOR = {}
   #core.model.MAGKEYS = {}
   #core.model.REGISTRY = {}
   #core.model.USERSCHOOL = {}    
   #wiki.model.WIKI = {}
   #wiki.model.WIKIMEMBER = {}
   #wiki.model.WIKICOMMUNITY = {}  
   #wiki.model.FILES = {}
   #log.model.LOG = {}
   #log.model.NEWS = {}
   core.model.MAGKEYS = MAGKEYS_DEFAULT()  # recria chave mágica para que possa fazer outro cadastro
   
   self.app = TestApp(WsgiApp())
   registry.update(REGISTRY_FORM)
   login.update(LOGIN_FORM)
   pagina = WIKI_FORM()
Example #15
0
  def setUp(self):
    
    core.model.REGISTRY = REGISTRY_DEFAULT()
    core.model.MAGKEYS = MAGKEYS_DEFAULT()
    core.model.INVITES = {}
    core.model.USERSCHOOL = {}
    log.model.NOTIFICATIONERROR = {}
    log.model.NOTIFICATION = {}
    
    self.app = TestApp(WsgiApp())
    registry.update(REGISTRY_FORM)

    # Cria usuários para os testes
    #registry['user'] = '******'
    self.app.post('/new/user', registry)
    core.model.REGISTRY['teste']['cod_institute'] = u"0002"
     
    # Faz login como usuário teste
    login.update(LOGIN_FORM)
    self.app.post('/login', login)
    core.model.REGISTRY['teste']['papeis'].append('professor')

    core.model.MAGKEYS = MAGKEYS_DEFAULT()    # recria chave mágica para que possa fazer outro cadastro