-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
42 lines (38 loc) · 1.46 KB
/
tests.py
File metadata and controls
42 lines (38 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from django.test import TestCase
from .models import GoDjangoNotify, GoDjangoNotifyFolders
from django.contrib.auth.models import User
#from django.contrib.auth.models import User
#from security.models import User
# Create your tests here.
class GDNTest(TestCase):
def setUp(self, *args, **kwargs):
self.gdnotify = GoDjangoNotify.objects.create(
dependant=User.objects.create(
username="test",
password="test"
)
)
self.folders = GoDjangoNotifyFolders.objects.create(gdn=self.gdnotify, folder="one_folder", is_enabled=True)
def test_gdn_push(self, *args, **kwargs):
self.gdnotify.push(data={
"tel": "+46764039298",
"addr": "Mi direccion",
"msg": "Una cosa",
"date": "now"
}, name=self.gdnotify.dependant.username)
self.gdnotify.push(data={
"tel": "+46764039298",
"addr": "Mi direccion",
"msg": "Otra cosa",
"date": "now"
}, name=self.gdnotify.dependant.username)
def test_gdn_tfm_push(self, *args, **kwargs):
self.gdnotify.push(data={
"tel": "+46764039298",
"addr": "Mi direccion",
"msg": "Una cosa",
"date": "now",
"tfm": "something",
}, name=self.gdnotify.dependant.username)
def test_gdn_clear(self, *args, **kwargs):
self.gdnotify.godjangonotifyfolders_set.first().clear()