Skip to content

Commit

Permalink
removed commented out code and added additional logins to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lunamoonmoon committed Jul 18, 2024
1 parent 82a51c9 commit 20605c7
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 17 deletions.
4 changes: 0 additions & 4 deletions app/backend/wells/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,10 +1912,6 @@ def save(self, *args, **kwargs):
if not self.create_date:
self.create_date = timezone.now()

# Logic already on the frontend in filters.py
# if self.legal_pid:
# self.legal_pid = self.legal_pid.replace('-', '')

return super().save(*args, **kwargs)


Expand Down
145 changes: 139 additions & 6 deletions tests/api-tests/submissions_api_tests.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "e90dc2af-da89-4df4-a49c-71d29b09c874",
"_postman_id": "8f8fdc37-50fd-4fe6-a3b4-e51a83c1c108",
"name": "GWELLS Submissions API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "33152761"
"_exporter_id": "37028467"
},
"item": [
{
Expand Down Expand Up @@ -391,7 +391,6 @@
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
Expand Down Expand Up @@ -2017,6 +2016,74 @@
{
"name": "Decommission",
"item": [
{
"name": "Log in Copy",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = pm.response.json()",
"pm.environment.set(\"token\", jsonData.access_token);",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.expect(pm.response.code, \"Login was not successful\").to.equal(200);",
"})",
"",
"pm.test(\"A token was returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.access_token, \"a token was not returned\").to.be.ok;",
" pm.expect(jsonData.access_token.length).to.be.above(36);",
"});",
""
]
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "{{client_secret}}",
"type": "string"
},
{
"key": "username",
"value": "{{client_id}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
}
]
},
"url": {
"raw": "{{auth_server}}",
"host": [
"{{auth_server}}"
]
},
"description": "Get token (log in)"
},
"response": []
},
{
"name": "Decommission well",
"event": [
Expand Down Expand Up @@ -2597,6 +2664,74 @@
}
]
},
{
"name": "Log in Copy",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = pm.response.json()",
"pm.environment.set(\"token\", jsonData.access_token);",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.expect(pm.response.code, \"Login was not successful\").to.equal(200);",
"})",
"",
"pm.test(\"A token was returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.access_token, \"a token was not returned\").to.be.ok;",
" pm.expect(jsonData.access_token.length).to.be.above(36);",
"});",
""
]
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "{{client_secret}}",
"type": "string"
},
{
"key": "username",
"value": "{{client_id}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
}
]
},
"url": {
"raw": "{{auth_server}}",
"host": [
"{{auth_server}}"
]
},
"description": "Get token (log in)"
},
"response": []
},
{
"name": "staff_edit Get",
"event": [
Expand Down Expand Up @@ -2945,7 +3080,6 @@
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
Expand Down Expand Up @@ -3080,7 +3214,6 @@
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
Expand Down Expand Up @@ -3833,4 +3966,4 @@
]
}
]
}
}
Loading

0 comments on commit 20605c7

Please sign in to comment.