Пример #1
0
 def test_admin_editor_middle(self):
     """
     Testing castom template tags. Passing RequestEntry object to function.
     Fetching url. And cheking status code after getting responce
     for this url.
     """
     middle = RequestEntry.objects.create(url_path='/edit/')
     url = re.search("href=(\S+)>", admin_editor_url(middle)).group(1)
     responce = self.client.get(url)
     self.assertEqual(responce.status_code, 200)
Пример #2
0
 def test_admin_editor_contact(self):
     """
     Testing castom template tags. Passing Contact object to function.
     Fetching url. And cheking status code after getting responce
     for this url.
     """
     contact = Contact.objects.all()[0]
     url = re.search("href=(\S+)>", admin_editor_url(contact)).group(1)
     responce = self.client.get(url)
     self.assertEqual(responce.status_code, 200)