@@ -0,0 +1,1709 @@
+import json%0A%0Afrom django.contrib.auth.models import User%0Afrom django.test import TestCase as TC, Client%0A%0Afrom testcube.core.models import Configuration%0A%0A%0Aclass ModelsTestCase(TC):%0A    def setUp(self):%0A        self.client = Client()%0A        self.admin = User.objects.create_superuser('admin', 'admin@test', 'admin')%0A        Configuration.objects.create(key='test', value='unit')%0A%0A    def test_visit_config(self):%0A        self.client.login(username='admin', password='admin')%0A        api = '/api/configurations/'%0A%0A        # get the list%0A        r = self.client.get(api)%0A        result = r.json()%0A        print(result)%0A        assert result%5B'count'%5D %3E= 1%0A%0A        # insert a config%0A        data = %7B'key': 1, 'value': 1%7D%0A        r = self.client.post(api, data=data).json()%0A        print(r)%0A        assert r%5B'key'%5D == '1'%0A%0A        # update a config%0A        url = r%5B'url'%5D%0A        data = json.dumps(%7B'key': 2, 'value': 3%7D)%0A        r = self.client.put(url, data=data, content_type='application/json').json()%0A        print(r)%0A        assert r%5B'value'%5D == '3'%0A%0A    def test_client_auth(self):%0A        info = %7B'client_type': 'testcube_test_client',%0A                'client_name': 'test name',%0A                'client_user': 'test user',%0A                'platform': 'windows'%7D%0A%0A        result = self.client.post('/client-register', data=info).json()%0A        print(result)%0A%0A        client = result%5B'client'%5D%0A        assert 'token' in result%0A        assert User.objects.get(username=client) != None%0A%0A        info%5B'client_type'%5D = 'some bad client'%0A        result = self.client.post('/client-register', data=info)%0A        assert result.status_code != 200%0A        assert %22Failed to register testcube%22 in str(result.content)%0A

add api tests.