def test_from_ip_without_account_anonymous(self): for ip in self.fixtures_pg[IP]: if ip.account: continue with self.subTest(ip=ip.ip): self.assertIsInstance(User.from_ip(ip.ip), AnonymousUserMixin)
def test_from_ip_correct_user(self): for ip in self.fixtures_pg[IP]: if not ip.account: continue with self.subTest(ip=ip.ip): self.assertEqual(User.get(ip.account), User.from_ip(ip.ip))