Exemple #1
0
 def __init__(self, testcase):
     self.tested_urls = {'get': [], 'post': []}
     views_attr = give.views.__dict__.keys()
     self.views_to_see = []
     for attr_str in views_attr:
         attr = give.views.__getattribute__(attr_str)
         if type(attr).__name__ == 'function' and \
                 attr.__module__ == 'give.views' and \
                 not attr_str.startswith('_'):
             self.views_to_see.append(attr_str)
     self.client = Client()
     self.username = randstr(30, True)
     self.create_user()
     self.testcase = testcase
Exemple #2
0
 def create_user(self):
     self.user_password = randstr(30, True)
     self.user = create_user(username=self.username,
                             password=self.user_password)
     give.models.UserWebsite.objects.create(
         user=self.user.get_profile(), url='http://example.com')