Exemple #1
0
    def test_join_normally(self):
        XUser.join(self.http_req, self.username, self.group_name)

        user = User.objects.get(username=self.username)
        user_added_to_group = user.groups.filter(name=self.group_name).exists()
        self.assertTrue(user_added_to_group, 'User should be added to group.')
Exemple #2
0
    def test_join_normally(self):
        XUser.join(self.http_req, self.username, self.group_name)

        user = User.objects.get(username=self.username)
        user_added_to_group = user.groups.filter(name=self.group_name).exists()
        self.assertTrue(user_added_to_group, 'User should be added to group.')
Exemple #3
0
 def test_join_nonexistent_group(self):
     try:
         XUser.join(self.http_req, self.username, 'nonexistent group name')
     except Fault as e:
         self.assertEqual(e.faultCode, 404)
Exemple #4
0
 def test_join_nonexistent_user(self):
     try:
         XUser.join(self.http_req, 'nonexistent user',
                    'whatever group name')
     except Fault as e:
         self.assertEqual(e.faultCode, 404)
Exemple #5
0
 def test_join_nonexistent_group(self):
     try:
         XUser.join(self.http_req, self.username, 'nonexistent group name')
     except Fault as e:
         self.assertEqual(e.faultCode, 404)
Exemple #6
0
 def test_join_nonexistent_user(self):
     try:
         XUser.join(self.http_req,
                    'nonexistent user', 'whatever group name')
     except Fault as e:
         self.assertEqual(e.faultCode, 404)