"""Tests related to embargoes of registrations"""
import datetime
import httplib as http
import json

import pytz
from django.core.exceptions import ValidationError
from django.utils import timezone

import mock
import pytest
from nose.tools import *  # noqa

from tests.base import fake, OsfTestCase
from osf_tests.factories import (
    AuthUserFactory, EmbargoFactory, NodeFactory, ProjectFactory,
    RegistrationFactory, UserFactory, UnconfirmedUserFactory, DraftRegistrationFactory,
    EmbargoTerminationApprovalFactory
)
from tests import utils

from framework.exceptions import PermissionsError, HTTPError
from framework.auth import Auth
from osf.exceptions import (
    InvalidSanctionRejectionToken, InvalidSanctionApprovalToken, NodeStateError,
)
from osf.utils import tokens
from osf.models import AbstractNode
from osf.models.sanctions import PreregCallbackMixin, Embargo
from osf.utils import permissions