예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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()
예제 #4
0
 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()
예제 #5
0
 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
예제 #6
0
 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