'Verify that no referral is recorded when a cookie is not present.'

@unittest.skipUnless((settings.ROOT_URLCONF == 'lms.urls'), 'Test    only    valid    in    lms')
def test_no_referral(self):

    utm_cookie_name = 'edx.test.utm'
    with mock.patch('student.models.RegistrationCookieConfiguration.current') as config:
        instance = config.return_value
        instance.utm_cookie_name = utm_cookie_name
        self.assertIsNone(self.client.cookies.get(settings.AFFILIATE_COOKIE_NAME))
        self.assertIsNone(self.client.cookies.get(utm_cookie_name))
        user = self.create_account_and_fetch_profile().user
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_AFFILIATE_ID))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_PARAMETERS.get('utm_source')))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_PARAMETERS.get('utm_medium')))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_PARAMETERS.get('utm_campaign')))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_PARAMETERS.get('utm_term')))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_PARAMETERS.get('utm_content')))
        self.assertIsNone(UserAttribute.get_user_attribute(user, REGISTRATION_UTM_CREATED_AT))
