def test_salted_fp_len(self): self.request.POST = {'fp': self.fp} fp_len = len(get(self.request, use_salt=True)['fp']) self.assertEqual(fp_len, 64)
def test_good_fingerprint(self): self.request.POST = {'fp': self.fp} self.assertEqual(get(self.request), self.fp)
def test_missing_fingerprint_field(self): with self.assertRaises(TemplateSyntaxError): get(self.request)
def test_wrong_fingerprint_length(self): self.request.POST = {'fp': 'qwerty'} with self.assertRaises(ValueError): get(self.request)
def test_empty_fingerprint(self): self.request.POST = {'fp': ''} with self.assertRaises(ConnectionError): get(self.request)
def test_wrong_argument(self): with self.assertRaises(TypeError): get(dict)