-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from mwanjajoel/tests
Tests
- Loading branch information
Showing
16 changed files
with
96 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
omit = | ||
env/* | ||
tests/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
SECRET_KEY= # SECRET_KEY | ||
DEBUG= #true for development dont sent in production | ||
DEBUG= #true for development dont sent in production | ||
DB_NAME= # database name | ||
DB_HOST= # database host | ||
DB_USER= # database user | ||
DB_PASSWORD= # database password | ||
DB_PORT = # database port | ||
CODECOV_TOKEN = # codecov token | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: python | ||
python: | ||
- '3.7' | ||
services: | ||
- postgresql | ||
addons: | ||
postgresql: '9.4' | ||
before_script: | ||
- pip install -r requirements.txt | ||
- psql -c 'create database momo;' -U postgres | ||
- python manage.py makemigrations --dry-run | ||
- python manage.py migrate | ||
script: | ||
- pytest | ||
env: | ||
global: | ||
secure: lyrPSV14XBHGVmo1KQT59rnb3k3Cg8WQTl1K3W7vtBqBxAWQ6EJAXyqCbvv6zte6oz1D/fgROAKX/EraQdZEGhBzIWoe4vbuK3zdG9PwQFa9IhNUx6oF6UsmFTCpmC71T352XyNKrrvd06KTtzvJkyS4wySMVQpo/jRVevaYDNw/B1sjkw6GiKp4RuKCRsU5FHXCBX5+8Kc9gIpz48IhEKrudHlctYWBXzMA/Ing8T5KItzaTAomqs3xAgoINzKGdMdakwjkc1maq53d3TpTupQubx6V7Pkr4ZVbJO1QKfWJiTqGiZ+4ACeaBfXLslRvqwRjGw2lBzWsT+rAS/EoXwCsK1e3xhwRjzHTqpbOOFw4Tl6OlPbbEsikrRxJ8JibhVK1IVagX0EJVETvYwMTUG6MQYWRFSHLX/6K3+27XnsdEkfvVedUplIEpU7P86CZ9TjrrTpe7XE3iFmTehcZ1XfXEYDcngQNdeM4AJtQ3FX6rxb70iA9skhAgselBGAd0O7gAx1SJSK8ddIvXkkzXlNiq4lSURZ2/acC5Up7obNZt01i1Rc3RIoXCns3PyZnaM6XbIR7OedN/wYPichUvnBFxW2Npwt+vSmT1VMXu1kIFuWGDyCj1HtMvzkdSlrV7+zIg9Ktbt8ptbvVKTLtRQVTx2VN3EYGz/Yuq/ORi9A= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Authors for the Django MoMo API App. | ||
|
||
- Mwanja Joel [(@mrmwanjajoel)](https://twitter.com/mrjoelmwanja) | ||
|
||
- Arthur Nangai [(@arthurnangai)](https://twitter.com/arthurnangai) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<p align="center"> | ||
<a href="https://twitter.com/mrjoelmwanja"> | ||
<img src="https://img.shields.io/badge/[email protected]?style=flat" alt="Twitter: @mrjoelmwanja" /> | ||
</a> | ||
</p> | ||
|
||
# Django MoMo API | ||
This is a django package for the MTN MoMo API. It can be added to your current django-based application so as to interact with the MTN MoMo API in a much simpler way. | ||
This is a django package for the MTN MoMo API. It can be added to your current django-based application so as to interact with the MTN MoMo API in a much simpler way. | ||
|
||
![Build Status](https://travis-ci.com/mwanjajoel/django-momoapi.svg?branch=develop) | ||
|
||
|
||
|
||
## Why we created the Django MoMo API Package | ||
MTN Uganda released API documentation to their Mobile Money service and integrations for Python, NodeJS, PHP, Java etc have been created but at the time of writing, there is no django package and yet Django is a popular Python based web framework. | ||
|
@@ -15,7 +14,12 @@ MTN Uganda released API documentation to their Mobile Money service and integrat | |
pip install django-momoapi | ||
``` | ||
## Development Setup | ||
|
||
``` | ||
- Create .env file following the .env_example. | ||
- Create a postgre database and its credentials to the .env file. | ||
- Run migrations using the command python manage.py migrate | ||
- Run application using the command python manage.py runserver | ||
``` | ||
|
||
## How to submit an issue | ||
|
||
|
@@ -30,8 +34,9 @@ We follow a strict code of conduct and you can read it [Here](CODE_OF_CONDUCT.md | |
|
||
## Credits | ||
|
||
Django MoMo API package was designed and built by Mwanja Joel, and is copyright © Mwanja Joel 2020. Django MoMo API is licensed under the MIT license; for the full license please see the [LICENSE](LICENSE) file. | ||
Django MoMo API package was designed and built by Mwanja Joel, and is copyright © Mwanja Joel 2020. Django MoMo API is licensed under the MIT license; for the full license please see the [LICENSE](LICENSE) file. | ||
|
||
Please see the [AUTHORS](AUTHORS) file for the full list of contributors. | ||
|
||
If you find Django MoMo API useful and want to reach out, find me on Twitter: [@mrjoelmwanja](https://twitter.com/mrjoelmwanja). | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MomoConfig(AppConfig): | ||
name = 'momo' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
DJANGO_SETTINGS_MODULE = djangomomoapi.settings | ||
python_files = tests.py test_*.py *_tests.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pytest | ||
|
||
# create a simple Pytest | ||
def test_user_create(): | ||
pass |