Simple test case for currency

This commit is contained in:
Oliver Walters 2019-09-03 09:19:37 +10:00
parent 32d09d2d37
commit 9f91797f42
4 changed files with 34 additions and 4 deletions

View File

@ -7,4 +7,4 @@ class CurrencyAdmin(admin.ModelAdmin):
list_display = ('symbol', 'suffix', 'description', 'value', 'base')
admin.site.register(Currency, CurrencyAdmin)
admin.site.register(Currency, CurrencyAdmin)

View File

@ -0,0 +1,16 @@
# Test fixtures for Currency objects
- model: common.currency
fields:
symbol: '$'
suffix: 'AUD'
description: 'Australian Dollars'
base: True
- model: common.currency
fields:
symbol: '$'
suffix: 'USD'
description: 'US Dollars'
base: False
value: 1.4

View File

@ -1,3 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here.
from .models import Currency
class CurrencyTest(TestCase):
""" Tests for Currency model """
fixtures = [
'currency',
]
def test_currency(self):
# Simple test for now (improve this later!)
self.assertEqual(Currency.objects.count(), 2)

View File

@ -1,3 +1 @@
from django.shortcuts import render
# Create your views here.