def test_add_default_groups_with_local_site(self):
        """Testing default group computation with LocalSite"""
        user = User.objects.get(pk=3)
        local_site = LocalSite.objects.create(name='test')
        self.create_review_group(is_default_group=True, local_site=local_site)

        group_count_before = user.review_groups.count()

        _add_default_groups(sender=None, user=user, local_site=local_site)

        self.assertEqual(group_count_before + 1,
                         User.objects.get(pk=user.id).review_groups.count())
    def test_add_default_groups_with_local_site(self):
        """Testing default group computation with LocalSite"""
        user = User.objects.get(pk=3)
        local_site = LocalSite.objects.create(name='test')
        self.create_review_group(is_default_group=True, local_site=local_site)

        group_count_before = user.review_groups.count()

        _add_default_groups(sender=None, user=user, local_site=local_site)

        self.assertEqual(group_count_before + 1,
                         User.objects.get(pk=user.id).review_groups.count())
    def test_add_default_groups(self):
        """Testing default group computation without LocalSite"""
        user = User.objects.get(pk=1)
        group_count_before = user.review_groups.count()

        _add_default_groups(sender=None, user=user)

        self.assertEqual(group_count_before,
                         User.objects.get(pk=user.id).review_groups.count())

        self.create_review_group(is_default_group=True)

        _add_default_groups(sender=None, user=user)

        self.assertEqual(group_count_before + 1,
                         User.objects.get(pk=user.id).review_groups.count())
    def test_add_default_groups(self):
        """Testing default group computation without LocalSite"""
        user = User.objects.get(pk=1)
        group_count_before = user.review_groups.count()

        _add_default_groups(sender=None, user=user)

        self.assertEqual(group_count_before,
                         User.objects.get(pk=user.id).review_groups.count())

        self.create_review_group(is_default_group=True)

        _add_default_groups(sender=None, user=user)

        self.assertEqual(group_count_before + 1,
                         User.objects.get(pk=user.id).review_groups.count())