|
7 | 7 | # Create your tests here.
|
8 | 8 | class GDNTest(TestCase):
|
9 | 9 | def setUp(self, *args, **kwargs):
|
10 |
| - gdnotify = GoDjangoNotify.objects.create( |
| 10 | + self.gdnotify = GoDjangoNotify.objects.create( |
11 | 11 | dependant=User.objects.create(
|
12 | 12 | username="test",
|
13 | 13 | password="test"
|
14 | 14 | )
|
15 | 15 | )
|
16 |
| - GoDjangoNotifyFolders.objects.create(gdn=gdnotify, folder="one_folder", is_enabled=True) |
| 16 | + self.folders = GoDjangoNotifyFolders.objects.create(gdn=self.gdnotify, folder="one_folder", is_enabled=True) |
17 | 17 |
|
18 | 18 | def test_gdn_push(self, *args, **kwargs):
|
19 |
| - user = User.objects.filter(username="test").first() |
20 |
| - gdnotify = GoDjangoNotify.objects.filter(dependant=user).first() |
21 |
| - gdnotify.push(data={ |
| 19 | + self.gdnotify.push(data={ |
22 | 20 | "tel": "+46764039298",
|
23 | 21 | "addr": "Mi direccion",
|
24 | 22 | "msg": "Una cosa",
|
25 | 23 | "date": "now"
|
26 |
| - }, name=user.username) |
| 24 | + }, name=self.gdnotify.dependant.username) |
| 25 | + self.gdnotify.push(data={ |
| 26 | + "tel": "+46764039298", |
| 27 | + "addr": "Mi direccion", |
| 28 | + "msg": "Otra cosa", |
| 29 | + "date": "now" |
| 30 | + }, name=self.gdnotify.dependant.username) |
27 | 31 |
|
28 | 32 | def test_gdn_tfm_push(self, *args, **kwargs):
|
29 |
| - user = User.objects.filter(username="test").first() |
30 |
| - gdnotify = GoDjangoNotify.objects.filter(dependant=user).first() |
31 |
| - gdnotify.push(data={ |
| 33 | + self.gdnotify.push(data={ |
32 | 34 | "tel": "+46764039298",
|
33 | 35 | "addr": "Mi direccion",
|
34 | 36 | "msg": "Una cosa",
|
35 | 37 | "date": "now",
|
36 | 38 | "tfm": "something",
|
37 |
| - }, name=user.username) |
| 39 | + }, name=self.gdnotify.dependant.username) |
38 | 40 |
|
39 | 41 | def test_gdn_clear(self, *args, **kwargs):
|
40 |
| - user = User.objects.filter(username="test").first() |
41 |
| - gdnotify = GoDjangoNotify.objects.filter(dependant=user).first() |
42 |
| - gdnotify.godjangonotifyfolders_set.first().clear() |
| 42 | + self.gdnotify.godjangonotifyfolders_set.first().clear() |
0 commit comments