Exemple #1
0
 def test_for_group_returns_all(self):
     group = mock_data.make_group()
     user = mock_data.make_user()
     user.groups.add(group)
     self._call_mockfn(enabled=True, for_groups=[group])
     self._call_mockfn(enabled=True)
     self.assertEqual(2, self.cls.objects.for_user(user).count())
Exemple #2
0
 def test_action_for_group_performed_for_user_in_group(self):
     user = mock_data.make_user()
     group = mock_data.make_group()
     user.groups.add(group)
     auth_kwargs = {
         "verb": models.verb_raise,
         "enabled": True,
         "for_groups": [group],
         "probability": 100,
     }
     self._call_mockfn(**auth_kwargs)
     self.assertEqual(1, self.cls.objects.for_user(user).count())
 def test_make_group_makes_group(self):
     group = mock_data.make_group()
     self.assertTrue(isinstance(group, Group))