Commit Graph

318 Commits

Author SHA1 Message Date
Andreas Zweili
148d388bd9 add test for multiple backups in backup table 2019-12-10 19:21:51 +01:00
Andreas Zweili
bf8da723ea correct computer links in Nets- and BackupTables 2019-12-10 19:21:15 +01:00
Andreas Zweili
f7a046046d replace pk with customer.id
When using the pk attribute django-tables2 takes the primary key of the data of
the current row. In this case this means that it takes the primary key of the
net itself and not of the related customer
2019-12-03 22:30:27 +01:00
Andreas Zweili
be35588d9d replace the pk with customer.id
When using the pk attribute django-tables2 takes the primary key of the data of
the current row. In this case this means that it takes the primary key of the
backup itself and not the related computer
2019-12-03 22:28:35 +01:00
Andreas Zweili
e7bee10750 change test_computer_detail_view_no_permission to 403
The view should actually block unauthorized access. Which this test confirms
and now works properly.
2019-12-03 22:18:14 +01:00
Andreas Zweili
ddcaf27a50 remove an unused import 2019-12-03 22:14:50 +01:00
Andreas Zweili
463e25010b add a customer property to the Warranty and Backup model 2019-12-01 22:51:54 +01:00
Andreas Zweili
9b8af679ed fix a typo 2019-12-01 22:42:20 +01:00
Andreas Zweili
70ccf4d607 add test for computer_detail_view without permission 2019-12-01 22:28:25 +01:00
Andreas Zweili
cb753b3ed2 add test for computer_detail_view with CPU relation 2019-12-01 22:27:25 +01:00
Andreas Zweili
f1b20e3c28 add test for computer_detail_view with RAID relation 2019-12-01 22:26:52 +01:00
Andreas Zweili
5d005499da add test for computer_detail_view with a RAM relation 2019-12-01 22:17:54 +01:00
Andreas Zweili
9827a04c56 add test for the computer_detail_view 2019-12-01 22:17:29 +01:00
Andreas Zweili
5064a3bff5 fix a typo 2019-11-30 16:51:22 +01:00
Andreas Zweili
8f8ff2328e correct the line length 2019-11-30 16:47:49 +01:00
Andreas Zweili
2de2e5ada1 remove unused import 2019-11-30 16:44:03 +01:00
Andreas Zweili
1caf974a0f remove unused import 2019-11-30 16:43:52 +01:00
Andreas Zweili
f93010f97b PEP8 2019-11-30 16:37:20 +01:00
Andreas Zweili
2185332d49 let mixer choose the customer 2019-11-30 16:37:07 +01:00
Andreas Zweili
6e17f41d83 rewrite the test to actually test the computer view
For some reason this test was testing the customer detail view but this is now
fixed.
2019-11-30 16:36:13 +01:00
Andreas Zweili
e8bf02ae86 remove unused imports 2019-11-30 16:09:18 +01:00
Andreas Zweili
5d2445f5d6 remove unused variables 2019-11-30 16:09:07 +01:00
Andreas Zweili
cbae8c9711 PEP8 2019-11-30 16:08:53 +01:00
Andreas Zweili
04eac793d6 import helper directly
this way I don't have to clean unused helper imports
2019-11-30 16:07:55 +01:00
Andreas Zweili
240028cdd3 remove unused import 2019-11-30 15:54:00 +01:00
Andreas Zweili
f00bc6b78b PEP8 2019-11-30 15:53:50 +01:00
Andreas Zweili
eb9b790f9a remove unused variables 2019-11-30 15:52:49 +01:00
Andreas Zweili
7a6fbe4d7b limit backup_view access 2019-11-30 14:15:20 +01:00
Andreas Zweili
be6c5dab7f add a decorator to check for the customer_view_permission 2019-11-30 14:14:01 +01:00
Andreas Zweili
005b521be7 add a computer object to the test 2019-11-30 13:30:59 +01:00
Andreas Zweili
6c4966b6d8 Merge branch 'master' into backup 2019-11-28 22:51:51 +01:00
Andreas Zweili
0ff88d3d00 add a viewport option to the base template header 2019-11-28 22:51:22 +01:00
Andreas Zweili
f9261c08c8 remove a debugging print statement 2019-11-28 22:51:04 +01:00
Andreas Zweili
88a20d8a05 fix the net_detail_view tests
I forgot to use the objects.create parameters function. This way the object
never got added to the database, therefore it never showed in the
content.response. And since I use the admin interface when testing manually,
which creates the objects slightly different and correctly the error never
showed up when doing it by hand.
2019-11-28 22:48:45 +01:00
Andreas Zweili
d93b25c256 add a link to the computer template which links to the customer 2019-09-24 20:31:01 +02:00
Andreas Zweili
a98dd4f2b0 add a backups table view 2019-09-24 20:30:43 +02:00
Andreas Zweili
ba20a056c3 split the view tests into multiple files 2019-09-09 10:59:28 +02:00
Andreas Zweili
53289a58f6 rewrite so that all the views get a pk object 2019-09-03 18:49:44 +02:00
Andreas Zweili
2d06992811 update the net_detail_view to display the NetDetailTable correctly 2019-09-01 12:18:46 +02:00
Andreas Zweili
d0e71ad7fb add the DeviceInNet model to the NetDetailTable 2019-09-01 12:17:37 +02:00
Andreas Zweili
f09a1c9bd6 add a link to the customer view 2019-09-01 12:17:06 +02:00
Andreas Zweili
69d9a24ff7 add a description field 2019-09-01 12:10:51 +02:00
Andreas Zweili
28dcd6834f add various verbose names to the DeviceInNet model 2019-09-01 12:10:33 +02:00
Andreas Zweili
69063bb0a2 add verbose name 2019-09-01 12:09:51 +02:00
Andreas Zweili
37f463361a change the status code check to 404
This view now works correctly and returns a 404 instead of an empty table.
2019-09-01 12:08:23 +02:00
Andreas Zweili
8a21e52ab4 extend the test for the net details 2019-09-01 12:07:56 +02:00
Andreas Zweili
dc273c271e reorder imports 2019-09-01 12:06:27 +02:00
Andreas Zweili
0ee532950b refactor so that mixer does the work 2019-08-30 23:15:36 +02:00
Andreas Zweili
f55f8ebd84 use a variable for the customer fixture 2019-08-30 23:15:11 +02:00
Andreas Zweili
e314c7bf47 fix the tests so that they are working with postgres 2019-08-30 23:14:47 +02:00
Andreas Zweili
8269dd7656 remove unnecessary object creations 2019-08-30 22:38:31 +02:00
Andreas Zweili
acc1472bd9 add LoginRequiredMixin to view 2019-08-30 22:37:49 +02:00
Andreas Zweili
fde7d492d4 fix the all computers list 2019-08-30 21:04:23 +02:00
Andreas Zweili
e012e1d576 add a computer to test 2019-08-30 21:04:00 +02:00
Andreas Zweili
f4f8fb95fe add login and logout button to base.html 2019-08-30 06:21:27 +02:00
Andreas Zweili
f86e1f0c6d ad rediret URLs 2019-08-30 06:21:23 +02:00
Andreas Zweili
528cd30c33 improve the regiration template 2019-08-29 23:11:11 +02:00
Andreas Zweili
961160babc rename the computer list to match the Django scheme 2019-08-28 23:09:34 +02:00
Andreas Zweili
605ad94acc remove unused code 2019-08-28 23:09:18 +02:00
Andreas Zweili
410a271328 create the fixture customer with mixer 2019-08-28 23:09:06 +02:00
Andreas Zweili
0e0870f2a7 remove fixture from test
This test should just return 200 even if there aren't any customers.
2019-08-28 22:29:56 +02:00
Andreas Zweili
c0bdfed79c move some settings to environment variables 2019-08-28 21:39:29 +02:00
Andreas Zweili
9d859f4ffc add login functionality 2019-08-25 22:35:03 +02:00
Andreas Zweili
5cdbf760e0 improve all tests which check for 302 2019-08-15 18:40:29 +02:00
Andreas Zweili
3e840b0aff fix the customer view permissions 2019-08-13 18:53:39 +02:00
Andreas Zweili
a43fc71521 fix the emacs config 2019-08-12 22:57:04 +02:00
Andreas Zweili
0409aef33c finalize test_computer_list_view 2019-08-11 22:54:33 +02:00
Andreas Zweili
1a92ce4e9a finalize test_computer_list_view_no_computers 2019-08-11 22:53:54 +02:00
Andreas Zweili
c87c762ab1 finalize test_backup_detail_view_not_found 2019-08-11 22:52:37 +02:00
Andreas Zweili
1dceb67d53 finalize test_backup_detail_view 2019-08-11 22:52:19 +02:00
Andreas Zweili
e6be2f3504 finalize test_net_detail_view_not_found 2019-08-11 22:49:29 +02:00
Andreas Zweili
9550e9b509 finalize test for test_net_detail_view 2019-08-11 21:44:13 +02:00
Andreas Zweili
bfb29e9de8 replace object creations with mixer 2019-08-11 21:36:29 +02:00
Andreas Zweili
210f583851 implement helper function 2019-08-11 21:35:49 +02:00
Andreas Zweili
efd33d49a6 finalize test for cpu relation 2019-08-11 20:57:37 +02:00
Andreas Zweili
e188b7ded4 finalize test for raid relation 2019-08-11 20:57:17 +02:00
Andreas Zweili
2aac3f53ed add test for ram relation 2019-08-11 20:56:39 +02:00
Andreas Zweili
e1edc3d238 use mixer in test_computer_detail_view 2019-08-11 20:55:01 +02:00
Andreas Zweili
2864649766 finalize test_customer_computer_table_no_computer 2019-08-11 20:54:39 +02:00
Andreas Zweili
1a71d65c12 finalize test_customer_computer_table 2019-08-11 20:54:18 +02:00
Andreas Zweili
37e9f58be4 finalize test_customer_detail_view_no_permissions 2019-08-11 20:42:13 +02:00
Andreas Zweili
c3be6198ed finalize test_customer_list_view 2019-08-11 20:41:43 +02:00
Andreas Zweili
64cf7e91f5 add mixer to the tests 2019-08-11 20:41:17 +02:00
Andreas Zweili
14ff7913de enable database access for the whole test_view.py file 2019-08-11 20:40:33 +02:00
Andreas Zweili
6aac688e8f remove the unnecessary raid type 2019-08-11 20:38:53 +02:00
Andreas Zweili
714449d038 move the coverage config 2019-08-11 20:38:37 +02:00
Andreas Zweili
a38f17141a update the docker settings 2019-08-11 18:37:56 +02:00
Andreas Zweili
521aaef946 run django with gunicorn 2019-08-11 18:37:37 +02:00
Andreas Zweili
9778d60f51 Revert "remove the production settings"
This reverts commit d8b09fd735.
2019-08-11 18:14:18 +02:00
Andreas Zweili
b9efd4ed60 move some settings to environment variables 2019-08-10 16:50:35 +02:00
Andreas Zweili
d8b09fd735 remove the production settings
they are the same as the docker settings
2019-08-10 15:28:52 +02:00
Andreas Zweili
27906f6923 remove the pytest config 2019-08-10 15:27:35 +02:00
Andreas Zweili
e5396aea5f add config for coverage 2019-08-10 13:56:19 +02:00
Andreas Zweili
c1631fe76e use a in memory database for local testing 2019-08-10 13:55:15 +02:00
Andreas Zweili
3833e02e60 add environment variable to emacs config 2019-08-10 13:54:55 +02:00
Andreas Zweili
3daf05a5c3 add check for status codes
When there is a 404 then there wouldn't be a "Novartis" string present so the
test would still pass.
2019-08-07 22:48:38 +02:00
Andreas Zweili
00725cec8a finalise test_customer_list_view_no_customer 2019-08-07 22:41:06 +02:00
Andreas Zweili
976321a39e PEP8 2019-08-07 22:38:30 +02:00
Andreas Zweili
1b8a8fc00f make sure only users with permissions can view customers 2019-08-07 22:37:59 +02:00
Andreas Zweili
a6ea6c545f add customer view permission test 2019-08-07 22:37:35 +02:00
Andreas Zweili
871562d2c8 remove an unused print statement 2019-08-07 18:19:49 +02:00
Andreas Zweili
d8e3459778 remove unused print 2019-08-06 22:34:29 +02:00
Andreas Zweili
bbb626e1b7 remove unnused code 2019-08-06 22:23:53 +02:00
Andreas Zweili
0e0e653b4f mark various tests as WIP 2019-08-06 22:23:39 +02:00
Andreas Zweili
373d4aa5f6 add test for empty customer list 2019-08-06 22:22:24 +02:00
Andreas Zweili
448fa67364 add tests for computer/hardware relations 2019-08-06 22:22:06 +02:00
Andreas Zweili
710224992f add tests for computer_list_view 2019-08-06 22:13:15 +02:00
Andreas Zweili
8ad61288ba remove unused code 2019-08-06 22:12:44 +02:00
Andreas Zweili
6d3f177b71 add tests for Net and Backup views 2019-08-06 22:03:46 +02:00
Andreas Zweili
d2a54d265a add tests for device views 2019-08-06 21:48:29 +02:00
Andreas Zweili
0fccb6f886 use get_object_or_404 with ConnectedDevice 2019-08-06 21:46:53 +02:00
Andreas Zweili
81b35d9772 use get_object_or_404 with device 2019-08-06 21:46:32 +02:00
Andreas Zweili
4fe8f4be6e test computer not found case 2019-08-06 21:41:55 +02:00
Andreas Zweili
e8c28e41d5 use get_object_or_404 in computer_view_permission 2019-08-06 21:41:31 +02:00
Andreas Zweili
4910a40336 remove unnused variables 2019-08-06 21:03:58 +02:00
Andreas Zweili
ac63104157 use objects.create whereever possible 2019-08-06 20:52:05 +02:00
Andreas Zweili
d920a9ba53 extend tests 2019-08-04 22:17:02 +02:00
Andreas Zweili
82f25255d4 only allow logged in users to acces pages 2019-08-04 22:15:30 +02:00
Andreas Zweili
671c7c1d8e add trailing slash to url 2019-08-04 22:14:20 +02:00
Andreas Zweili
3933e04e9c refactor the tests 2019-08-04 20:50:10 +02:00
Andreas Zweili
b022b1747d refacture the fixtures
the fixtures where overcomplicated and should be easier.
2019-08-04 20:46:02 +02:00
Andreas Zweili
5317f42349 extend the views with login required 2019-08-04 20:44:37 +02:00
Andreas Zweili
74677e6c2d rearrange the urls 2019-08-04 20:44:19 +02:00
Andreas Zweili
be7cfb7da9 add AllComputersView 2019-08-02 16:54:32 +02:00
Andreas Zweili
15eea784ac use the minimal css from semantic 2019-08-02 16:54:02 +02:00
Andreas Zweili
268337cc5b implement a basic backup view 2019-08-02 14:31:55 +02:00
Andreas Zweili
bb650d6d04 hide hardware card if none is present 2019-08-02 14:19:08 +02:00
Andreas Zweili
660a183e34 remove a div 2019-08-02 13:40:06 +02:00
Andreas Zweili
672949f4b2 implement cards ui for computers 2019-08-02 13:39:14 +02:00
Andreas Zweili
35d399eac5 implement django-tables2 2019-08-02 13:05:42 +02:00
Andreas Zweili
3c28f6fd70 add verbose names to the Computer and Net model 2019-08-02 13:04:25 +02:00
Andreas Zweili
e3a789b125 add djang-tables2 to the apps 2019-08-02 12:21:40 +02:00
Andreas Zweili
cf7f1ee6d2 implement the semantic css theme 2019-08-02 12:21:05 +02:00
Andreas Zweili
4353b7e1dd extend the ComputerDetailView with various properties 2019-07-30 23:17:56 +02:00
Andreas Zweili
0c2f76bcf1 make the tables a bit smaller in order to fit more information 2019-07-30 23:16:59 +02:00
Andreas Zweili
7fd85a1040 add IPs to the computer view 2019-07-29 21:16:14 +02:00
Andreas Zweili
27fb338a7f add views for nets 2019-07-28 22:02:07 +02:00
Andreas Zweili
503ccb4d5a allow the customer description to be empty 2019-07-28 21:41:17 +02:00
Andreas Zweili
113afb4f6c add first_name field 2019-07-28 21:10:30 +02:00
Andreas Zweili
438b2bdc43 add hyper_threading field 2019-07-28 21:10:11 +02:00
Andreas Zweili
2284e6eaa0 move the DeviceManufacturer class to companies.py 2019-07-28 21:09:51 +02:00
Andreas Zweili
d1ebb7b94d add a NotificationFromBackup class 2019-07-28 21:07:27 +02:00
Andreas Zweili
7213b59f98 change url of the devices list 2019-07-25 20:42:09 +02:00
Andreas Zweili
462d0169eb small reformating of the customer table 2019-07-25 20:41:52 +02:00
Andreas Zweili
1d6c631af3 remove the list_of_lists 2019-07-25 20:37:03 +02:00
Andreas Zweili
91672e8128 rename the views for better clarity 2019-07-25 20:35:22 +02:00
Andreas Zweili
33ef653602 extend the home index page 2019-07-25 20:35:05 +02:00
Andreas Zweili
368eb670e2 add a customers details page 2019-07-25 20:34:52 +02:00
Andreas Zweili
9fec74496a change to relativ imports 2019-07-25 20:13:04 +02:00
Andreas Zweili
f8531e6014 add list of lists
this lists show all the lists related to the currently selected customer.
2019-07-24 22:56:08 +02:00