tests.py 712 Bytes
Newer Older
1
from django.conf import settings
Aymeric Barantal's avatar
Aymeric Barantal committed
2
3
from django.test import TestCase

4
from picampaign.campaign.models import Campaign, CampaignContact
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from picampaign.contact.models import Contact

class CampaignContactMethodTests(TestCase):
    def test_all_groups_is_empty(self):
        campaign = Campaign(
            title='Campaign Title',
            start_date='2000-01-01',
            end_date='2100-12-31'
        )
        contact = Contact(
            first_name='Victor',
            last_name='Hugo',
            phone='+3312345678'
        )
        campaigncontact = CampaignContact(
            campaign=campaign,
            contact=contact
        )
        self.assertEqual(campaigncontact.all_groups(),[])