Skip to content

Commit

Permalink
NFS exports restored as read-only - continued 1 rockstor#2912
Browse files Browse the repository at this point in the history
- Add default ordering to NFSExportGroup models.
Addresses re-enabled test provoked warnings re:
"UnorderedObjectListWarning: Pagination may yield inconsistent
results with an unordered object_list"
  • Loading branch information
phillxnet committed Nov 7, 2024
1 parent 6c89004 commit 92d5cbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/rockstor/storageadmin/models/nfs_export_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ class NFSExportGroup(models.Model):

class Meta:
app_label = "storageadmin"
ordering = ['-id']
24 changes: 9 additions & 15 deletions src/rockstor/storageadmin/tests/test_nfs_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,15 @@ def setUpClass(cls):
def tearDownClass(cls):
super(NFSExportTests, cls).tearDownClass()

# TODO: FAIL {"detail":"Not found."}
# def test_get(self):
# """
# Test GET request
# 1. Get base URL
# 2. Get request with id
# """
# # get base URL
# self.get_base(self.BASE_URL)
#
# # get nfs-export with id
# nfs_id = self.temp_nfsexport.id
# response = self.client.get('{}/{}'.format(self.BASE_URL, nfs_id))
# self.assertEqual(response.status_code, status.HTTP_200_OK,
# msg=response)
def test_get(self):

# get base URL
self.get_base(self.BASE_URL)

# get nfs-export with id
nfs_id = 3 # from fixture
response = self.client.get(f'{self.BASE_URL}/{nfs_id}')
self.assertEqual(response.status_code, status.HTTP_200_OK, msg=response)

def test_invalid_get(self):
# get nfs-export with invalid id
Expand Down

0 comments on commit 92d5cbf

Please sign in to comment.