changeset 6875:e81332582fc9

controllers: drop unused totalRecords and startIndex We don't want it just for testing.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 14 Sep 2017 02:08:06 +0200
parents 06ef965e4b62
children 6db3122e4d75
files kallithea/controllers/admin/repo_groups.py kallithea/controllers/admin/user_groups.py kallithea/controllers/admin/users.py kallithea/model/repo.py kallithea/tests/functional/test_home.py kallithea/tests/functional/test_my_account.py kallithea/tests/functional/test_repo_groups.py
diffstat 7 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/admin/repo_groups.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/controllers/admin/repo_groups.py	Thu Sep 14 02:08:06 2017 +0200
@@ -141,8 +141,6 @@
             })
 
         c.data = {
-            "totalRecords": total_records,
-            "startIndex": 0,
             "sort": None,
             "dir": "asc",
             "records": repo_groups_data
--- a/kallithea/controllers/admin/user_groups.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/controllers/admin/user_groups.py	Thu Sep 14 02:08:06 2017 +0200
@@ -119,8 +119,6 @@
             })
 
         c.data = {
-            "totalRecords": total_records,
-            "startIndex": 0,
             "sort": None,
             "dir": "asc",
             "records": user_groups_data
--- a/kallithea/controllers/admin/users.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/controllers/admin/users.py	Thu Sep 14 02:08:06 2017 +0200
@@ -103,8 +103,6 @@
             })
 
         c.data = {
-            "totalRecords": total_records,
-            "startIndex": 0,
             "sort": None,
             "dir": "asc",
             "records": users_data
--- a/kallithea/model/repo.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/model/repo.py	Thu Sep 14 02:08:06 2017 +0200
@@ -230,8 +230,6 @@
             repos_data.append(row)
 
         return {
-            "totalRecords": len(repos_list),
-            "startIndex": 0,
             "sort": "name",
             "dir": "asc",
             "records": repos_data
--- a/kallithea/tests/functional/test_home.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/tests/functional/test_home.py	Thu Sep 14 02:08:06 2017 +0200
@@ -20,7 +20,6 @@
         response.mustcontain('<span class="repotag">git')
 
         # html in javascript variable:
-        response.mustcontain('var data = ({"totalRecords": %s' % Repository.query().count())
         response.mustcontain(r'href=\"/%s\"' % HG_REPO)
 
         response.mustcontain(r'\x3ci class=\"icon-globe\"')
--- a/kallithea/tests/functional/test_my_account.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/tests/functional/test_my_account.py	Thu Sep 14 02:08:06 2017 +0200
@@ -32,7 +32,8 @@
         response = self.app.get(url('my_account_repos'))
         cnt = Repository.query().filter(Repository.owner ==
                            User.get_by_username(TEST_USER_ADMIN_LOGIN)).count()
-        response.mustcontain('"totalRecords": %s' % cnt)
+        response.mustcontain('"raw_name": "%s"' % HG_REPO)
+        response.mustcontain('"just_name": "%s"' % GIT_REPO)
 
     def test_my_account_my_watched(self):
         self.log_user()
@@ -40,7 +41,8 @@
 
         cnt = UserFollowing.query().filter(UserFollowing.user ==
                             User.get_by_username(TEST_USER_ADMIN_LOGIN)).count()
-        response.mustcontain('"totalRecords": %s' % cnt)
+        response.mustcontain('"raw_name": "%s"' % HG_REPO)
+        response.mustcontain('"just_name": "%s"' % GIT_REPO)
 
     def test_my_account_my_emails(self):
         self.log_user()
--- a/kallithea/tests/functional/test_repo_groups.py	Thu Sep 14 02:08:06 2017 +0200
+++ b/kallithea/tests/functional/test_repo_groups.py	Thu Sep 14 02:08:06 2017 +0200
@@ -6,7 +6,7 @@
     def test_index(self):
         self.log_user()
         response = self.app.get(url('repos_groups'))
-        response.mustcontain('{"totalRecords": 0, "sort": null, "startIndex": 0, "dir": "asc", "records": []}')
+        response.mustcontain('"records": []')
 
     def test_new(self):
         self.log_user()
@@ -57,7 +57,6 @@
 
         # listing
         response = self.app.get(url('repos_groups'))
-        response.mustcontain('"totalRecords": 1')
         response.mustcontain('raw_name": "%s"' % group_name)
 
         # show