Ejemplo n.º 1
0
 def test_known_signature(self):
     slug = 'foo'
     doc = document(slug=slug)
     doc.save()
     sig = Signature(signature=slug, document=doc)
     sig.save()
     url = urlparams(reverse('postcrash.api'), s=slug)
     response = self.client.get(url)
     eq_(200, response.status_code)
     eq_('https://example.com/kb/%s' % slug, response.content)
     eq_('text/plain', response['content-type'])
Ejemplo n.º 2
0
 def test_get_absolute_url(self):
     doc = document(slug='foo-bar')
     doc.save()
     sig = Signature(signature='baz', document=doc)
     eq_('/kb/foo-bar', sig.get_absolute_url())