Exemplo n.º 1
0
    def test_del_contact_list(self):
        #import pdb; pdb.set_trace()
        url = get_url_by_name('del_contact',{'app_name':'tpa1com','owner_id':'150031','contact_id':'150014'})
        print bcolors.blue('REQUEST TO %s' % url)
        responce = requests.get(url)

        if responce.status_code <> 200:
            for par in re.findall('<pre class="exception_value">(.*?)<\/pre>',responce.content):
                print bcolors.red('#######%s######' % par)

        outdata = json.loads(responce.content)
        print bcolors.blue(outdata)
Exemplo n.º 2
0
    def test_add_contact_list(self):
        # import pdb; pdb.set_trace()
        url = get_url_by_name("add_contact", {"app_name": "tpa1com", "owner_id": "150031", "contact_id": "150014"})
        print bcolors.blue("REQUEST TO %s" % url)
        responce = requests.get(url)

        if responce.status_code <> 200:
            for par in re.findall('<pre class="exception_value">(.*?)<\/pre>', responce.content):
                print bcolors.red("#######%s######" % par)

        outdata = json.loads(responce.content)
        print bcolors.blue(outdata)
 def test_profile_user_from_tpa(self):
     url = get_url_by_name('get_profile_from_tpa',{'user_id': '150031'})
     print bcolors.blue('REQUEST TO %s' % url)
     responce = requests.get(url)
     #print responce.content
     try:
         outdata = json.loads(responce.content)
     except Exception, err:
         
         
         for par in re.findall('<pre class="exception_value">(.*?)<\/pre>',responce.content):
             print bcolors.red('#######%s######' % par)
         #print responce.content
         self.fail(err)