def test_request_quota(self): if self.ignore: return test_url = '/sync/request_quota' test_string = "This is the test string" self.log_in() #get the intro page form = self.app.get(test_url) assert "taking a survey to see why" in form #bad crumb badcrumb = self.app.post(test_url, {'reason': test_string}) assert "We have received your request for more space" not in badcrumb #submit the page delete = self.app.post(test_url, {'reason': test_string, 'crumb': get_crumb(badcrumb.body)}) assert "We have received your request for more space" in delete #make sure the data was written to the file filename = self.config.get('console.quota_request_file') if filename: try: file = open(filename, 'r') except IOError: logging.error("error opening file %s" % (filename)) else: string = "%s\t%s\n" % (self.username, test_string) assert string in file.read()
def test_purge_data(self): if self.ignore: return test_url = '/sync/purge' change_string = 'Your data has been successfully removed' url_problem = 'We had a problem' self.log_in() #get the form form = self.app.get(test_url) assert "delete the content of your sync account" in form assert "Your data has been successfully removed" not in form #bad crumb badcrumb = self.app.post(test_url, {'purge': 'Purge My Data'}) assert "Your data has been successfully removed" not in badcrumb results = self.app.post(test_url, {'purge': 'Purge My Data', 'crumb': get_crumb(badcrumb.body)}) assert change_string or url_problem in results