def setUp(self): make_test_nodes() make_test_registry_entries(100) self.api_user = _make_api_user() self.api_admin = _make_api_admin() entry = RegistryEntry.objects.filter(first_node__namespace=settings.DPN_NAMESPACE)[0] self.url = reverse('api:registry-detail', kwargs={'dpn_object_id': entry.dpn_object_id})
def setUp(self): # Setup Test Data make_test_nodes() make_test_registry_entries(100) make_test_transfers() self.url = reverse('api:transfer-list') self.api_user = _make_api_user() self.api_admin = _make_api_admin()
def setUp(self): # Setup Test Data make_test_nodes() make_test_registry_entries(100) make_test_transfers() self.url = reverse('api:transfer-list') self.api_user = _make_api_user() self.api_admin = _make_api_admin()
def setUp(self): make_test_nodes() make_test_registry_entries(100) self.api_user = _make_api_user() self.api_admin = _make_api_admin() entry = RegistryEntry.objects.filter( first_node__namespace=settings.DPN_NAMESPACE)[0] self.url = reverse('api:registry-detail', kwargs={'dpn_object_id': entry.dpn_object_id})
def handle(self, *args, **options): if not settings.DEV: raise CommandError("ABORTING: This command should only be run in development!") # Clear Everything out Storage.objects.all().delete() Port.objects.all().delete() Node.objects.all().delete() make_test_nodes()
def setUp(self): make_test_nodes() make_test_registry_entries(100) make_test_transfers() self.api_user = _make_api_user() self.api_admin = _make_api_admin() self.superuser = User.objects.create_superuser( username="******", password="******", email="*****@*****.**")
def setUp(self): make_test_nodes() make_test_registry_entries(100) make_test_transfers() self.api_user = _make_api_user() self.api_admin = _make_api_admin() self.superuser = User.objects.create_superuser( username="******", password="******", email="*****@*****.**" )
def test_data(self): xfer = CreateTransferSerializer(data=XFER_POST) # It should fail to validate if related objects not created. self.assertFalse(xfer.is_valid(), "Did not expect this to validate!") make_test_nodes() data = make_registry_data() data['dpn_object_id'] = XFER_POST["dpn_object_id"] data['first_node'] = Node.objects.get(namespace=XFER_POST["node"]) re = RegistryEntry(**data) re.save() # It should validate with good data. xfer = CreateTransferSerializer(data=XFER_POST) self.assertTrue(xfer.is_valid(), xfer._errors)
def test_data(self): xfer = CreateTransferSerializer(data=XFER_POST) # It should fail to validate if related objects not created. self.assertFalse(xfer.is_valid(), "Did not expect this to validate!") make_test_nodes() data = make_registry_data() data['dpn_object_id'] = XFER_POST["dpn_object_id"] data['first_node'] = Node.objects.get(namespace=XFER_POST["node"]) re = RegistryEntry(**data) re.save() # It should validate with good data. xfer = CreateTransferSerializer(data=XFER_POST) self.assertTrue(xfer.is_valid(), xfer._errors)
def handle(self, *args, **options): if not settings.DEV: raise CommandError("ABORTING: This command should only be run in development!") print("Creating Test Nodes...") for node in Node.objects.all(): node.delete() make_test_nodes() if not Node.objects.get(namespace=settings.DPN_NAMESPACE): raise CommandError("No %s node!" % settings.DPN_NAMESPACE) print("Importing usergroups...") call_command('loaddata', '../data/GroupPermissions.json') print("Creating Test Users...") for u in User.objects.all(): u.delete() for node in Node.objects.exclude(namespace=settings.DPN_NAMESPACE): usr = make_test_user( "%s_user" % node.namespace, node.namespace, "*****@*****.**", groupname="api_users", nodename=node.namespace ) # Clear Bag Data = funny pattern due to sqlite3 for reg in RegistryEntry.objects.all(): reg.delete() for xfer in Transfer.objects.all(): xfer.delete() print("Creating Registry Entries...") make_test_registry_entries(1000) print("Creating Transfers...") make_test_transfers() print("Creating Superuser...") call_command("createsuperuser")
def test_data(self): make_test_nodes() reg = RegistryEntrySerializer(data=REGISTRY_DATA) self.assertTrue(reg.is_valid(), reg._errors)
def test_data(self): make_test_nodes() reg = RegistryEntrySerializer(data=REGISTRY_DATA) self.assertTrue(reg.is_valid(), reg._errors)
def setUp(self): make_test_nodes() self.url = reverse('api:node-list') self.api_user = _make_api_user() self.api_admin = _make_api_admin() self.auth_user = _make_auth_user()
def setUp(self): make_test_nodes() make_test_registry_entries(30) make_test_transfers()
def setUp(self): make_test_nodes() self.url = reverse('api:node-list') self.api_user = _make_api_user() self.api_admin = _make_api_admin() self.auth_user = _make_auth_user()