Skip to content

Commit

Permalink
spdx#200 Fixing Unit test failure - test_archive_license_requests_fea…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
BanulaKumarage committed Mar 11, 2023
1 parent a7b3b34 commit 3a955b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import NoSuchElementException
from webdriver_manager.firefox import GeckoDriverManager
import time

Expand Down Expand Up @@ -1115,11 +1116,11 @@ def test_archive_license_requests_feature(self):
license_name = driver.find_element_by_css_selector('td').text
self.assertEqual(license_name, "BSD Zero Clause License-00")
self.assertEqual(LicenseRequest.objects.get(id=license_obj.id).archive, False)
if driver.find_element_by_id('archive_button' + str(license_obj.id)):
try:
driver.find_element_by_id('archive_button' + str(license_obj.id)).click()
driver.find_element_by_id('confirm_archive').click()
self.assertEqual(LicenseRequest.objects.get(id=license_obj.id).archive, True)
else:
except NoSuchElementException:
pass

@skipIf(not getAccessToken() and not getGithubUserId() and not getGithubUserName(), "You need to set gihub parameters in the secret.py file for this test to be executed properly.")
Expand Down

0 comments on commit 3a955b1

Please sign in to comment.