Example #1
0
    def test_init_with_id(self):
        usergroups = UserGroups(usergroups={})
        usergroups.id = '666'

        self.assertIsNotNone(usergroups)
        self.assertEqual('666', usergroups.id)
        self.assertEqual({'_id': '666', 'usergroups': {}}, usergroups.to_document())
Example #2
0
    def test_init_no_id(self):
        usergroups = UserGroups(usergroups={})

        self.assertIsNotNone(usergroups)
        self.assertIsNone(usergroups.id)
        self.assertEqual({'usergroups': {}}, usergroups.to_document())