예제 #1
0
    def test_create(self):
        testers = Room.create(self.unicef, "Testers", 'G-007')
        jan = Contact.create(self.unicef, self.admin, "Jan", "janet", 'tel:1234', testers, 'C-007')
        bob = User.create(self.unicef, "Bob", "bobby", "*****@*****.**", "pass", False, [testers], [])
        ken = User.create(self.unicef, "Ken", "kenny", "*****@*****.**", "pass", False, [], [testers])

        self.assertEqual(testers.org, self.unicef)
        self.assertEqual(testers.name, "Testers")
        self.assertEqual(testers.uuid, 'G-007')
        self.assertEqual(list(testers.get_contacts()), [jan])
        self.assertEqual(list(testers.get_users().order_by('profile__full_name')), [bob, ken])
        self.assertEqual(list(testers.get_managers()), [ken])
예제 #2
0
    def test_create(self):
        testers = Room.create(self.unicef, "Testers", 'G-007')
        jan = Contact.create(self.unicef, self.admin, "Jan", "janet",
                             'tel:1234', testers, 'C-007')
        bob = User.create(self.unicef, "Bob", "bobby", "*****@*****.**",
                          "pass", False, [testers], [])
        ken = User.create(self.unicef, "Ken", "kenny", "*****@*****.**",
                          "pass", False, [], [testers])

        self.assertEqual(testers.org, self.unicef)
        self.assertEqual(testers.name, "Testers")
        self.assertEqual(testers.uuid, 'G-007')
        self.assertEqual(list(testers.get_contacts()), [jan])
        self.assertEqual(
            list(testers.get_users().order_by('profile__full_name')),
            [bob, ken])
        self.assertEqual(list(testers.get_managers()), [ken])
예제 #3
0
 def create_contact(self, org, full_name, chat_name, urn, room, uuid):
     user = org.administrators.first()
     return Contact.create(org, user, full_name, chat_name, urn, room, uuid)
예제 #4
0
 def create_contact(self, org, full_name, chat_name, urn, room, uuid):
     user = org.administrators.first()
     return Contact.create(org, user, full_name, chat_name, urn, room, uuid)