예제 #1
0
 def test_create_url(self):
     p = Page()
     p.save()
     u = URL(TEST_URL)
     u.add_content(p)
     self.assertTrue(p.content_ptr in u.get_content(),
                      "URL does not point to correct content.")
예제 #2
0
 def test_lookup_by_url(self):
     p = Page()
     p.save()
     u = URL(TEST_URL)
     u.add_content(p)
     found = URL.objects.get(url=TEST_URL)
     self.assertTrue(p.content_ptr in found.get_content(),
                      "Unable to find correct content by URL.")