diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..e9645219442fd869398f86f8adb48f1d69a16de5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,11 @@ +image: docker.io/python:3-alpine + +before_script: + - pip install --upgrade pip + - pip install -r requirements.txt + +unittest: + script: + - python manage.py test + + diff --git a/clades/migrations/0001_initial.py b/clades/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..75a5801cc11ce00ad767f70fd73c4b0ee2e7e2db --- /dev/null +++ b/clades/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# -*- 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)), + ], + ), + ] diff --git a/clades/models.py b/clades/models.py index 71a836239075aa6e6e4ecb700e9c42c95c022d91..aed846c203f20b481588498f0c3ab0941dbdf2a1 100644 --- a/clades/models.py +++ b/clades/models.py @@ -1,3 +1,5 @@ from django.db import models -# Create your models here. +class Kingdom(models.Model): + name = models.CharField(max_length=255, unique=True) + diff --git a/clades/tests.py b/clades/tests.py index 7ce503c2dd97ba78597f6ff6e4393132753573f6..e7b56d54ddf6c77c7c07fddba2f5ed81d4b70a56 100644 --- a/clades/tests.py +++ b/clades/tests.py @@ -1,3 +1,11 @@ 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)