@@ -315,13 +315,12 @@ def test_get_only_favorites_no_sort(self):
315
315
dashboard_6 .favorited_by = [user_2 .id ]
316
316
317
317
self .login_as (user_1 )
318
- with self .feature ("organizations:dashboards-favourite" ):
319
- response = self .client .get (self .url , data = {"filter" : "onlyFavorites" })
320
- assert response .status_code == 200 , response .content
318
+ response = self .client .get (self .url , data = {"filter" : "onlyFavorites" })
319
+ assert response .status_code == 200 , response .content
321
320
322
- values = [row ["title" ] for row in response .data ]
323
- # sorted by title by default
324
- assert values == ["Dashboard 3" , "Dashboard 4" , "Dashboard 5" ]
321
+ values = [row ["title" ] for row in response .data ]
322
+ # sorted by title by default
323
+ assert values == ["Dashboard 3" , "Dashboard 4" , "Dashboard 5" ]
325
324
326
325
def test_get_only_favorites_with_sort (self ):
327
326
user_1 = self .create_user (username = "user_1" )
@@ -366,14 +365,13 @@ def test_get_only_favorites_with_sort(self):
366
365
dashboard_7 .favorited_by = [user_2 .id ]
367
366
368
367
self .login_as (user_1 )
369
- with self .feature ("organizations:dashboards-favourite" ):
370
- response = self .client .get (
371
- self .url , data = {"filter" : "onlyFavorites" , "sort" : "dateCreated" }
372
- )
373
- assert response .status_code == 200 , response .content
368
+ response = self .client .get (
369
+ self .url , data = {"filter" : "onlyFavorites" , "sort" : "dateCreated" }
370
+ )
371
+ assert response .status_code == 200 , response .content
374
372
375
- values = [row ["title" ] for row in response .data ]
376
- assert values == ["Dashboard 4" , "Dashboard 3" , "Dashboard 5" ]
373
+ values = [row ["title" ] for row in response .data ]
374
+ assert values == ["Dashboard 4" , "Dashboard 3" , "Dashboard 5" ]
377
375
378
376
def test_get_exclude_favorites_with_no_sort (self ):
379
377
user_1 = self .create_user (username = "user_1" )
@@ -418,13 +416,12 @@ def test_get_exclude_favorites_with_no_sort(self):
418
416
dashboard_6 .favorited_by = [user_2 .id ]
419
417
420
418
self .login_as (user_1 )
421
- with self .feature ("organizations:dashboards-favourite" ):
422
- response = self .client .get (self .url , data = {"filter" : "excludeFavorites" })
423
- assert response .status_code == 200 , response .content
419
+ response = self .client .get (self .url , data = {"filter" : "excludeFavorites" })
420
+ assert response .status_code == 200 , response .content
424
421
425
- values = [row ["title" ] for row in response .data ]
426
- # sorted by title by default
427
- assert values == ["General" , "Dashboard 1" , "Dashboard 2" , "Dashboard 6" , "Dashboard 7" ]
422
+ values = [row ["title" ] for row in response .data ]
423
+ # sorted by title by default
424
+ assert values == ["General" , "Dashboard 1" , "Dashboard 2" , "Dashboard 6" , "Dashboard 7" ]
428
425
429
426
def test_get_exclude_favorites_with_sort (self ):
430
427
user_1 = self .create_user (username = "user_1" )
@@ -469,14 +466,13 @@ def test_get_exclude_favorites_with_sort(self):
469
466
dashboard_6 .favorited_by = [user_2 .id ]
470
467
471
468
self .login_as (user_1 )
472
- with self .feature ("organizations:dashboards-favourite" ):
473
- response = self .client .get (
474
- self .url , data = {"filter" : "excludeFavorites" , "sort" : "dateCreated" }
475
- )
476
- assert response .status_code == 200 , response .content
469
+ response = self .client .get (
470
+ self .url , data = {"filter" : "excludeFavorites" , "sort" : "dateCreated" }
471
+ )
472
+ assert response .status_code == 200 , response .content
477
473
478
- values = [row ["title" ] for row in response .data ]
479
- assert values == ["General" , "Dashboard 1" , "Dashboard 2" , "Dashboard 7" , "Dashboard 6" ]
474
+ values = [row ["title" ] for row in response .data ]
475
+ assert values == ["General" , "Dashboard 1" , "Dashboard 2" , "Dashboard 7" , "Dashboard 6" ]
480
476
481
477
def test_pin_favorites_with_my_dashboards_sort (self ):
482
478
user_1 = self .create_user (username = "user_1" )
@@ -513,21 +509,20 @@ def test_pin_favorites_with_my_dashboards_sort(self):
513
509
dashboard_E .favorited_by = [self .user .id ]
514
510
dashboard_C .favorited_by = [user_1 .id ]
515
511
516
- with self .feature ("organizations:dashboards-favourite" ):
517
- response = self .client .get (self .url , data = {"sort" : "mydashboards" , "pin" : "favorites" })
518
- assert response .status_code == 200 , response .content
519
- values = [row ["title" ] for row in response .data ]
520
- assert values == [
521
- # favorites
522
- "Dashboard D" , # self.user's favorite
523
- "Dashboard E" , # user_1's dashboard
524
- "Dashboard B" , # user_1's dashboard
525
- # other dashboards
526
- "Dashboard A" , # self.user's dashboard
527
- "Dashboard 2" , # self.user's dashboard
528
- "Dashboard 1" , # self.user's dashboard
529
- "Dashboard C" , # user_1's dashbaord
530
- ]
512
+ response = self .client .get (self .url , data = {"sort" : "mydashboards" , "pin" : "favorites" })
513
+ assert response .status_code == 200 , response .content
514
+ values = [row ["title" ] for row in response .data ]
515
+ assert values == [
516
+ # favorites
517
+ "Dashboard D" , # self.user's favorite
518
+ "Dashboard E" , # user_1's dashboard
519
+ "Dashboard B" , # user_1's dashboard
520
+ # other dashboards
521
+ "Dashboard A" , # self.user's dashboard
522
+ "Dashboard 2" , # self.user's dashboard
523
+ "Dashboard 1" , # self.user's dashboard
524
+ "Dashboard C" , # user_1's dashbaord
525
+ ]
531
526
532
527
def test_pin_favorites_with_my_date_created_sort (self ):
533
528
user_1 = self .create_user (username = "user_1" )
@@ -564,21 +559,20 @@ def test_pin_favorites_with_my_date_created_sort(self):
564
559
dashboard_E .favorited_by = [self .user .id ]
565
560
dashboard_C .favorited_by = [user_1 .id ]
566
561
567
- with self .feature ("organizations:dashboards-favourite" ):
568
- response = self .client .get (self .url , data = {"sort" : "dateCreated" , "pin" : "favorites" })
569
- assert response .status_code == 200 , response .content
570
- values = [row ["title" ] for row in response .data ]
571
- assert values == [
572
- # favorites
573
- "Dashboard B" ,
574
- "Dashboard D" ,
575
- "Dashboard E" ,
576
- # other dashboards
577
- "Dashboard 1" ,
578
- "Dashboard 2" ,
579
- "Dashboard A" ,
580
- "Dashboard C" ,
581
- ]
562
+ response = self .client .get (self .url , data = {"sort" : "dateCreated" , "pin" : "favorites" })
563
+ assert response .status_code == 200 , response .content
564
+ values = [row ["title" ] for row in response .data ]
565
+ assert values == [
566
+ # favorites
567
+ "Dashboard B" ,
568
+ "Dashboard D" ,
569
+ "Dashboard E" ,
570
+ # other dashboards
571
+ "Dashboard 1" ,
572
+ "Dashboard 2" ,
573
+ "Dashboard A" ,
574
+ "Dashboard C" ,
575
+ ]
582
576
583
577
def test_post (self ):
584
578
response = self .do_request ("post" , self .url , data = {"title" : "Dashboard from Post" })
@@ -1445,16 +1439,15 @@ def test_dasboard_list_permissions_is_valid(self):
1445
1439
def test_gets_dashboard_favorited_with_dashboard_list (self ):
1446
1440
self .dashboard .favorited_by = [self .user .id ]
1447
1441
1448
- with self .feature ({"organizations:dashboards-favourite" : True }):
1449
- response = self .do_request ("get" , self .url )
1450
- assert response .status_code == 200 , response .content
1442
+ response = self .do_request ("get" , self .url )
1443
+ assert response .status_code == 200 , response .content
1451
1444
1452
- for dashboard in response .data :
1453
- assert "isFavorited" in dashboard
1454
- self .assert_equal_dashboards (self .dashboard , response .data [1 ])
1455
- assert response .data [1 ]["isFavorited" ] is True
1456
- assert response .data [0 ]["isFavorited" ] is False # general template
1457
- assert response .data [2 ]["isFavorited" ] is False # dashboard_2 w/ no favorites set
1445
+ for dashboard in response .data :
1446
+ assert "isFavorited" in dashboard
1447
+ self .assert_equal_dashboards (self .dashboard , response .data [1 ])
1448
+ assert response .data [1 ]["isFavorited" ] is True
1449
+ assert response .data [0 ]["isFavorited" ] is False # general template
1450
+ assert response .data [2 ]["isFavorited" ] is False # dashboard_2 w/ no favorites set
1458
1451
1459
1452
def test_post_errors_widget_with_is_filter (self ):
1460
1453
data : dict [str , Any ] = {
0 commit comments