# Running Django Tests in Oracle

**URL:** https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638
**Category:** Deployment
**Created:** [March 16, 2022, 9:41am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638 "2022-03-16T09:41:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dabeeeenster](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/dabeeeenster/32/7815_2.png) [@dabeeeenster](https://forum.djangoproject.com/u/dabeeeenster)
#### Post date: [March 16, 2022, 9:41am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/1 "2022-03-16T09:41:13Z")

</div>

Hi. I have a [project](https://github.com/Flagsmith) that currently supports Postgres, MySQL and Oracle. We have our Django tests running via `pytest`, and they currently work fine on MySQL and Postgres. We’ve spent days trying to get the tests to run in an automated manner in Oracle and have not managed to get it working.

The only way we’ve managed to get the tests working is using the Oracle VirtualBox VM as mentioned [here](https://code.djangoproject.com/wiki/OracleTestSetup). This is not viable as a CI/CD action.

Is there a canonical answer to getting Django tests running against an Oracle Docker image? I’m happy to accept licensing terms etc from Oracle Inc, but I just cannot find a way of getting it to work. It seems like the main issue is around permissions and the tests trying to create a database.

Thanks!  
Ben

---

<div class="post-metadata">

### Author: ![dabeeeenster](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/dabeeeenster/32/7815_2.png) [@dabeeeenster](https://forum.djangoproject.com/u/dabeeeenster)
#### Post date: [March 16, 2022, 10:11am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/2 "2022-03-16T10:11:14Z")

</div>

Just to follow up - I’m happy to sponsor this work if we can get it running in a hands-off environment!

---

<div class="post-metadata">

### Author: ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)
#### Post date: [March 16, 2022, 10:52am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/3 "2022-03-16T10:52:42Z")

</div>

Hi,

You can try to use a docker image from the [Oracle containers repository](https://container-registry.oracle.com). It contains a single pluggable database with an access to the `SYS` user so you should be able to create a main user with `DBA` privileges, as described in:

[https://code.djangoproject.com/wiki/OracleTestSetup](https://code.djangoproject.com/wiki/OracleTestSetup)

Best,  
Mariusz

---

<div class="post-metadata">

### Author: ![dabeeeenster](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/dabeeeenster/32/7815_2.png) [@dabeeeenster](https://forum.djangoproject.com/u/dabeeeenster)
#### Post date: [March 16, 2022, 11:04am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/4 "2022-03-16T11:04:17Z")

</div>

> [@felixxm](#):
>
> you should be able to create a main user with `DBA` privileges

Is there a way of doing this inside a CI/CD action?

---

<div class="post-metadata">

### Author: ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)
#### Post date: [March 16, 2022, 11:18am UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/5 "2022-03-16T11:18:12Z")

</div>

It should be doable. You can run SQL scripts via `sqlplus`, see a [similar scripts](https://github.com/django/djangoproject.com/blob/59875ae7973351e603085ab969cd8a848a758303/.github/workflows/tests.yml#L38-L46) where we set up PostgreSQL database via `psql` for GitHub actions.

---

<div class="post-metadata">

### Author: ![dabeeeenster](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/dabeeeenster/32/7815_2.png) [@dabeeeenster](https://forum.djangoproject.com/u/dabeeeenster)
#### Post date: [March 16, 2022, 12:19pm UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/6 "2022-03-16T12:19:24Z")

</div>

Thanks @felixxm will take a look.

Is there anywhere that this happens in a CICD action as part of Django as a whole? How do tests run against Oracle during core platform development?

---

<div class="post-metadata">

### Author: ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)
#### Post date: [March 16, 2022, 12:39pm UTC](https://forum.djangoproject.com/t/running-django-tests-in-oracle/12638/7 "2022-03-16T12:39:26Z")

</div>

> [@dabeeeenster](#):
>
> Is there anywhere that this happens in a CICD action as part of Django as a whole?

No, an instance is set up in advance.

> [@dabeeeenster](#):
>
> How do tests run against Oracle during core platform development?

We have a separate server with Oracle DB used by [https://djangoci.com](https://djangoci.com).
