def test_notification_reverse_url(): try: set_urlconf("shuup_tests.notify.notification_test_urls") n = Notification(shop=factories.get_default_shop()) kwargs = dict(viewname="test", kwargs={"arg": "yes"}) # kwargs within kwargs, oh my n.set_reverse_url(**kwargs) n.save() with pytest.raises(ValueError): n.set_reverse_url() assert n.url == reverse(**kwargs) finally: set_urlconf(None)
def test_notification_reverse_url(): try: set_urlconf("shuup_tests.notify.notification_test_urls") n = Notification() kwargs = dict(viewname="test", kwargs={"arg": "yes"}) # kwargs within kwargs, oh my n.set_reverse_url(**kwargs) n.save() with pytest.raises(ValueError): n.set_reverse_url() assert n.url == reverse(**kwargs) finally: set_urlconf(None)
def test_urlless_notification(): assert not Notification().url