Mercurial > public > madeira
comparison email_list/tests/test_models.py @ 167:1b5b9be17764
failIf is deprecated; replace with assertFalse.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 02 Apr 2015 20:30:35 -0500 |
parents | 3062c547bb90 |
children |
comparison
equal
deleted
inserted
replaced
166:491f0acbaeaf | 167:1b5b9be17764 |
---|---|
19 now = datetime.datetime.now() | 19 now = datetime.datetime.now() |
20 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) | 20 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) |
21 | 21 |
22 self.assertTrue(sub.status == 'A') | 22 self.assertTrue(sub.status == 'A') |
23 self.assertTrue(sub.is_active()) | 23 self.assertTrue(sub.is_active()) |
24 self.failIf(sub.is_pending()) | 24 self.assertFalse(sub.is_pending()) |
25 self.failIf(sub.is_leaving()) | 25 self.assertFalse(sub.is_leaving()) |
26 | 26 |
27 def test_set_pending(self): | 27 def test_set_pending(self): |
28 | 28 |
29 sub = Subscriber(name='', location='', email='test@example.com') | 29 sub = Subscriber(name='', location='', email='test@example.com') |
30 sub.set_pending() | 30 sub.set_pending() |
31 | 31 |
32 now = datetime.datetime.now() | 32 now = datetime.datetime.now() |
33 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) | 33 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) |
34 | 34 |
35 self.assertTrue(sub.status == 'P') | 35 self.assertTrue(sub.status == 'P') |
36 self.failIf(sub.is_active()) | 36 self.assertFalse(sub.is_active()) |
37 self.assertTrue(sub.is_pending()) | 37 self.assertTrue(sub.is_pending()) |
38 self.failIf(sub.is_leaving()) | 38 self.assertFalse(sub.is_leaving()) |
39 | 39 |
40 self.assertTrue(len(sub.key) == sub.key_length) | 40 self.assertTrue(len(sub.key) == sub.key_length) |
41 | 41 |
42 def test_set_active(self): | 42 def test_set_active(self): |
43 | 43 |
47 now = datetime.datetime.now() | 47 now = datetime.datetime.now() |
48 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) | 48 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) |
49 | 49 |
50 self.assertTrue(sub.status == 'A') | 50 self.assertTrue(sub.status == 'A') |
51 self.assertTrue(sub.is_active()) | 51 self.assertTrue(sub.is_active()) |
52 self.failIf(sub.is_pending()) | 52 self.assertFalse(sub.is_pending()) |
53 self.failIf(sub.is_leaving()) | 53 self.assertFalse(sub.is_leaving()) |
54 | 54 |
55 def test_set_leaving(self): | 55 def test_set_leaving(self): |
56 | 56 |
57 sub = Subscriber(name='', location='', email='test@example.com') | 57 sub = Subscriber(name='', location='', email='test@example.com') |
58 sub.set_leaving() | 58 sub.set_leaving() |
59 | 59 |
60 now = datetime.datetime.now() | 60 now = datetime.datetime.now() |
61 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) | 61 self.assertTrue(now - sub.status_date < datetime.timedelta(seconds=2)) |
62 | 62 |
63 self.assertTrue(sub.status == 'L') | 63 self.assertTrue(sub.status == 'L') |
64 self.failIf(sub.is_active()) | 64 self.assertFalse(sub.is_active()) |
65 self.failIf(sub.is_pending()) | 65 self.assertFalse(sub.is_pending()) |
66 self.assertTrue(sub.is_leaving()) | 66 self.assertTrue(sub.is_leaving()) |
67 | 67 |
68 self.assertTrue(len(sub.key) == sub.key_length) | 68 self.assertTrue(len(sub.key) == sub.key_length) |
69 | 69 |
70 def test_gen_key(self): | 70 def test_gen_key(self): |