From ee6bd896a072f1a9bffe76a2f7dbfb832ef631a9 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Thu, 27 Dec 2018 16:39:30 +0000 Subject: [PATCH 1/5] Migrations for 'runtests': runtests/migrations/0008_auto_20181227_1738.py - Add field is_deleted to profileoperation - Add field remark to profileoperation - Add field replica_id to profileoperation - Alter field order on profileoperation Fixes #28 --- .../migrations/0008_auto_20181227_1738.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 apitester/runtests/migrations/0008_auto_20181227_1738.py diff --git a/apitester/runtests/migrations/0008_auto_20181227_1738.py b/apitester/runtests/migrations/0008_auto_20181227_1738.py new file mode 100644 index 0000000..9cff0d8 --- /dev/null +++ b/apitester/runtests/migrations/0008_auto_20181227_1738.py @@ -0,0 +1,33 @@ +# Generated by Django 2.0.7 on 2018-12-27 16:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('runtests', '0007_auto_20181115_1557'), + ] + + operations = [ + migrations.AddField( + model_name='profileoperation', + name='is_deleted', + field=models.IntegerField(default=0, help_text='Deleted', verbose_name='Deleted'), + ), + migrations.AddField( + model_name='profileoperation', + name='remark', + field=models.CharField(blank=True, help_text='remark', max_length=255, null=True, verbose_name='remark'), + ), + migrations.AddField( + model_name='profileoperation', + name='replica_id', + field=models.IntegerField(default=1, help_text='Test Replica id', verbose_name='Replica id'), + ), + migrations.AlterField( + model_name='profileoperation', + name='order', + field=models.IntegerField(default=100, help_text='Test order', verbose_name='Order'), + ), + ] From 71cab3fc5d899fd1226d231bd9025984eca46856 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Thu, 3 Jan 2019 14:36:37 +0000 Subject: [PATCH 2/5] Removed time.sleep(t) causing Name error exception. Fixes #30 --- apitester/runtests/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apitester/runtests/views.py b/apitester/runtests/views.py index c78ac32..b5135c2 100644 --- a/apitester/runtests/views.py +++ b/apitester/runtests/views.py @@ -329,7 +329,6 @@ def get_context_data(self, **kwargs): for i in range(num_runs): result = self.run_test(config) LOGGER.log(logging.INFO,result) - time.sleep(t) except APIError as err: context['messages'].append(err) return context @@ -465,4 +464,4 @@ def deleteJsonBody(request): profile.is_deleted = 1 profile.save() - return JsonResponse({'state': True}) \ No newline at end of file + return JsonResponse({'state': True}) From 6289862c8f10194afbe8489b03713469704142db Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 4 Jan 2019 21:02:59 +0000 Subject: [PATCH 3/5] added unit test: test_create_test_configuration.py Ref issue #35 --- apitester/test_create_test_configuration.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 apitester/test_create_test_configuration.py diff --git a/apitester/test_create_test_configuration.py b/apitester/test_create_test_configuration.py new file mode 100644 index 0000000..a16198e --- /dev/null +++ b/apitester/test_create_test_configuration.py @@ -0,0 +1,12 @@ +from django.test import TestCase +from runtests.models import TestConfiguration + +class NewTestConfigurationTestCase(TestCase): + ''' + Create a new (empty) TestConfiguration model. + ''' + def test_create_test_configuration(self): + test_config = TestConfiguration(owner_id=1, name='Fred', + api_version='3.0.1') + test_config.save() + return test_config From c988cd39dc71c1a81c5403961e6eb17fc0f5586b Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 4 Jan 2019 21:02:59 +0000 Subject: [PATCH 4/5] added unit test: test_create_test_configuration.py Ref issue #35 --- apitester/test_create_test_configuration.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 apitester/test_create_test_configuration.py diff --git a/apitester/test_create_test_configuration.py b/apitester/test_create_test_configuration.py new file mode 100644 index 0000000..a16198e --- /dev/null +++ b/apitester/test_create_test_configuration.py @@ -0,0 +1,12 @@ +from django.test import TestCase +from runtests.models import TestConfiguration + +class NewTestConfigurationTestCase(TestCase): + ''' + Create a new (empty) TestConfiguration model. + ''' + def test_create_test_configuration(self): + test_config = TestConfiguration(owner_id=1, name='Fred', + api_version='3.0.1') + test_config.save() + return test_config From 7b51b6bfed056d635955e5b2790a49e5c39d0d55 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Mon, 7 Jan 2019 13:52:10 +0000 Subject: [PATCH 5/5] corrected api version 3.0.1=> 3.1.0 --- apitester/test_create_test_configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apitester/test_create_test_configuration.py b/apitester/test_create_test_configuration.py index a16198e..a161539 100644 --- a/apitester/test_create_test_configuration.py +++ b/apitester/test_create_test_configuration.py @@ -7,6 +7,6 @@ class NewTestConfigurationTestCase(TestCase): ''' def test_create_test_configuration(self): test_config = TestConfiguration(owner_id=1, name='Fred', - api_version='3.0.1') + api_version='3.1.0') test_config.save() return test_config