Skip to content

Commit

Permalink
Moved test module inside Django Ledger Application.
Browse files Browse the repository at this point in the history
Created dev_env with a simple development environment.
README.md Update
  • Loading branch information
elarroba committed Oct 18, 2021
1 parent 9cd44f7 commit 79b0934
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 13 deletions.
4 changes: 2 additions & 2 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Django Ledger was created by [Miguel Sanda](https://github.com/elarroba).
* Miguel Sanda [@elarroba](https://github.com/elarroba)
* Michael Noel [@mnooel](https://github.com/mnooel)

### Accountants & Bookkeepers
### Accountants, CPAs & Bookkeepers
* Miguel Sanda [@elarroba](https://github.com/elarroba)
* Albert Salazar [@Beachwood619](https://github.com/Beachwood619)
* Michael Noel [@mnooel](https://github.com/mnooel)
* Michael Noel, CPA [@mnooel](https://github.com/mnooel)
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,44 @@ urlpatterns = [
]
```

# Screenshots
# How To Set Up Django Ledger for Development
Django Ledger comes with a basic development environments already configured under __dev_env/__ folder not to be used
for production environments. If you want to contribute to the project perform the following steps:

1. Navigate to your projects directory.
2. Clone the repo from github and CD into project.
```shell
git clone https://github.com/arrobalytics/django-ledger.git
cd django-ledger
```
3. Install PipEnv, if not already installed:
```shell
pip install -U pipenv
```
4. Create virtual environment.
```shell
pipenv install
```
If using a specific version of Python you may specify the path.
```shell
pipenv install --python PATH_TO_INTERPRETER
```
5. Activate environment.
```shell
pipenv shell
```
7. Run development server.
```shell
python manage.py runserver
```

# Run Test Suite
After setting up your development environment you may run tests.
```shell
python manage.py test django_ledger
```

# Screenshots
![django ledger entity dashboard](https://us-east-1.linodeobjects.com/django-ledger/public/img/django_ledger_entity_dashboard.png)
![django ledger balance sheet](https://us-east-1.linodeobjects.com/django-ledger/public/img/django_ledger_income_statement.png)
![django ledger income statement](https://us-east-1.linodeobjects.com/django-ledger/public/img/django_ledger_balance_sheet.png)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/asgi.py → dev_env/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dev_env.settings')

application = get_asgi_application()
6 changes: 3 additions & 3 deletions tests/settings.py → dev_env/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
'django.contrib.messages',
'django.contrib.staticfiles',

'tests',
'django_ledger'

]

MIDDLEWARE = [
Expand All @@ -28,7 +28,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'tests.urls'
ROOT_URLCONF = 'dev_env.urls'

TEMPLATES = [
{
Expand All @@ -47,7 +47,7 @@
},
]

WSGI_APPLICATION = 'tests.wsgi.application'
WSGI_APPLICATION = 'dev_env.wsgi.application'

# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/wsgi.py → dev_env/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dev_env.settings')

application = get_wsgi_application()
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions tests/test_auth.py → django_ledger/tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.urls import reverse

from tests.base import DjangoLedgerBaseTest
from tests.settings import LOGIN_URL
from django_ledger.tests.base import DjangoLedgerBaseTest
from dev_env.settings import LOGIN_URL


class AuthTest(DjangoLedgerBaseTest):
Expand Down Expand Up @@ -73,4 +73,3 @@ def test_user_can_logout(self):

response = self.client.get(logout_url)
self.assertRedirects(response, expected_url=login_url)

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_entity_views(self):
text=reverse('django_ledger:entity-delete',
kwargs={
'entity_slug': entity_model.slug
})) # ENTITY-LIST VIEW...
})) # ENTITY-LIST VIEW...

# # HOME VIEW
# with self.assertNumQueries(3):
Expand Down
2 changes: 1 addition & 1 deletion tests/manage.py → manage.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dev_env.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down

0 comments on commit 79b0934

Please sign in to comment.