def post_valid_data(self, wait_mail=True): data = {'timestamp': self.timestamp, 'security_hash': self.security_hash, 'name': 'Alice Bloggs', 'email': '*****@*****.**', 'message': MESSAGE} self.response = self.client.post( reverse("contactme-post-contact-form"), data=data) if wait_mail and mail_sent_queue.get(block=True): pass
def post_valid_data(self, wait_mail=True): data = { 'timestamp': self.timestamp, 'security_hash': self.security_hash, 'name': 'Alice Bloggs', 'email': '*****@*****.**', 'message': MESSAGE } self.response = self.client.post( reverse("contactme-post-contact-form"), data=data) if wait_mail and mail_sent_queue.get(block=True): pass
def setUp(self): self.response = self.client.get(reverse("contactme-get-contact-form")) for context in self.response.context: if 'form' in context: form = context.get("form") timestamp = form.initial["timestamp"] security_hash = form.initial["security_hash"] data = {'timestamp': timestamp, 'security_hash': security_hash, 'name': 'Alice Bloggs', 'email': '*****@*****.**', 'message': MESSAGE} self.response = self.client.post( reverse("contactme-post-contact-form"), data=data) if mail_sent_queue.get(block=True): pass self.url = re.search(r'http://[\S]+', mail.outbox[0].body).group()
def setUp(self): self.response = self.client.get(reverse("contactme-get-contact-form")) for context in self.response.context: if 'form' in context: form = context.get("form") timestamp = form.initial["timestamp"] security_hash = form.initial["security_hash"] data = { 'timestamp': timestamp, 'security_hash': security_hash, 'name': 'Alice Bloggs', 'email': '*****@*****.**', 'message': MESSAGE } self.response = self.client.post( reverse("contactme-post-contact-form"), data=data) if mail_sent_queue.get(block=True): pass self.url = re.search(r'http://[\S]+', mail.outbox[0].body).group()
def get_confirm_contact_url(self, key, wait_mail=True): self.response = self.client.get(reverse("contactme-confirm-contact", kwargs={'key': key})) if wait_mail and mail_sent_queue.get(block=True): pass
def get_confirm_contact_url(self, key, wait_mail=True): self.response = self.client.get( reverse("contactme-confirm-contact", kwargs={'key': key})) if wait_mail and mail_sent_queue.get(block=True): pass