Skip to content
Snippets Groups Projects
Commit ae6a2311 authored by Evili del Rio i Silvan's avatar Evili del Rio i Silvan
Browse files

Merge branch 'tdd' into 'master'

Incorporate Tests to master branch



See merge request !2
parents a46f39e4 cddd8fc6
No related branches found
No related tags found
1 merge request!2Incorporate Tests to master branch
image: docker.io/python:3-alpine
before_script:
- pip install --upgrade pip
- pip install -r requirements.txt
unittest:
script:
- python manage.py test
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-20 10:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Kingdom',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True)),
],
),
]
from django.db import models
# Create your models here.
class Kingdom(models.Model):
name = models.CharField(max_length=255, unique=True)
from django.test import TestCase
# Create your tests here.
from .models import Kingdom
_KINGDOM_NAME = 'Animalia'
class KingdomTest(TestCase):
def test_kingdom_name(self):
kingdom = Kingdom(name=_KINGDOM_NAME)
kingdom.save()
self.assertEqual(kingdom.name, _KINGDOM_NAME)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment