<commit_before>from unittest.mock import patch

from corehq.apps.accounting.models import Subscription
from corehq.apps.groups.models import Group

from ..views import NotificationsServiceRMIView


def test_should_hide_feature_notifs_for_pro_with_groups():
    with case_sharing_groups_patch(['agroupid']):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for pro domain with groups"


def test_should_hide_feature_notifs_for_pro_without_groups():
    with case_sharing_groups_patch([]), active_service_type_patch("not_IMPLEMENTATION_or_SANDBOX"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert not hide, "notifications should not be hidden for pro domain without groups"


def test_should_hide_feature_notifs_for_non_pro_with_groups():
    with case_sharing_groups_patch(['agroupid']), active_service_type_patch("not_IMPLEMENTATION_or_SANDBOX"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", None)
        assert not hide, "notifications should not be hidden for pro domain without groups"


def test_should_hide_feature_notifs_for_implementation_subscription():
    with case_sharing_groups_patch([]), active_service_type_patch("IMPLEMENTATION"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for IMPLEMENTATION subscription"


def test_should_hide_feature_notifs_for_sandbox_subscription():
    with case_sharing_groups_patch([]), active_service_type_patch("SANDBOX"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for SANDBOX subscription"


def test_should_hide_feature_notifs_bug():
    with case_sharing_groups_patch([]), active_service_type_patch():
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", None)
        assert not hide, "notifications should not be hidden for null subscription"<commit_msg>Remove invalid test<commit_after>from unittest.mock import patch

from corehq.apps.accounting.models import Subscription
from corehq.apps.groups.models import Group

from ..views import NotificationsServiceRMIView


def test_should_hide_feature_notifs_for_pro_with_groups():
    with case_sharing_groups_patch(['agroupid']):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for pro domain with groups"


def test_should_hide_feature_notifs_for_pro_without_groups():
    with case_sharing_groups_patch([]), active_service_type_patch("not_IMPLEMENTATION_or_SANDBOX"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert not hide, "notifications should not be hidden for pro domain without groups"


def test_should_hide_feature_notifs_for_implementation_subscription():
    with case_sharing_groups_patch([]), active_service_type_patch("IMPLEMENTATION"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for IMPLEMENTATION subscription"


def test_should_hide_feature_notifs_for_sandbox_subscription():
    with case_sharing_groups_patch([]), active_service_type_patch("SANDBOX"):
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", "pro")
        assert hide, "notifications should be hidden for SANDBOX subscription"


def test_should_hide_feature_notifs_bug():
    with case_sharing_groups_patch([]), active_service_type_patch():
        hide = NotificationsServiceRMIView._should_hide_feature_notifs("test", None)
        assert not hide, "notifications should not be hidden for null subscription"
{'fraction_non_alphanumeric': 0.07391078838174274, 'fraction_numerical': 0.0, 'mean_word_length': 6.3606870229007635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3424794', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1091, 'n_words': 238}