CapPaste: Also check the title in can_post

Because unsurprisingly pastealacon has silly restrictions.
This commit is contained in:
Laurent Bachelier 2011-05-05 00:18:45 +02:00
commit dd6864c2c4
4 changed files with 18 additions and 10 deletions

View file

@ -82,12 +82,12 @@ class PastealaconTest(BackendTest):
def test_can_post(self):
assert 0 == self.backend.can_post('hello', public=False)
assert 1 == self.backend.can_post('hello', public=True)
assert 1 <= self.backend.can_post('hello', public=True)
assert 0 == self.backend.can_post('hello', public=True, max_age=600)
assert 1 == self.backend.can_post('hello', public=True, max_age=3600*24)
assert 1 == self.backend.can_post('hello', public=True, max_age=3600*24*3)
assert 1 == self.backend.can_post('hello', public=True, max_age=False)
assert 1 == self.backend.can_post('hello', public=None, max_age=False)
assert 1 == self.backend.can_post('hello', public=True, max_age=3600*24*40)
assert 1 == self.backend.can_post(u'héhé', public=True)
assert 1 <= self.backend.can_post('hello', public=True, max_age=3600*24)
assert 1 <= self.backend.can_post('hello', public=True, max_age=3600*24*3)
assert 1 <= self.backend.can_post('hello', public=True, max_age=False)
assert 1 <= self.backend.can_post('hello', public=None, max_age=False)
assert 1 <= self.backend.can_post('hello', public=True, max_age=3600*24*40)
assert 1 <= self.backend.can_post(u'héhé', public=True)
assert 0 == self.backend.can_post(u'hello ♥', public=True)