Esempio n. 1
0
    def setUp(self):
        """
        Create test client, login with the given user and create a new publication.
        """
        if self.user_id == None:
            res = run_sql("SELECT id FROM user WHERE nickname='admin'")
            assert (len(res) == 1, "Couldn't find admin user")
            self.user_id = int(res[0][0])

        uname = get_nickname(self.user_id)
        self.assertEqual(uname, "admin")

        self.client = TestClient(response_wrapper=JSONResponse)
        self.client.login(uname, '')
        self.client_noauth = TestClient(response_wrapper=JSONResponse)
        self.pub = OpenAIREPublication(self.user_id)
        self.pub_id = self.pub.publicationid
Esempio n. 2
0
 def setUp(self):
     """
     Create test client, login with the given user and create a new publication.
     """
     self.client = TestClient()
     self.client.login('admin', '')