Skip to content

[tests] Add missing sample_config admin tests on 1.1#995

Closed
asmodehn wants to merge 2 commits into
openwisp:1.1from
asmodehn:add_missing_sample_config_tests
Closed

[tests] Add missing sample_config admin tests on 1.1#995
asmodehn wants to merge 2 commits into
openwisp:1.1from
asmodehn:add_missing_sample_config_tests

Conversation

@asmodehn
Copy link
Copy Markdown
Member

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Description of Changes

This PR adds tests that seemed to be missing among the sample_config tests

This is currently a draft to check tests behaviour in the pipeline, using 1.1 as my current setup.
I plan to rebase on master later on.

@asmodehn asmodehn force-pushed the add_missing_sample_config_tests branch from 3c06f57 to fb3ded5 Compare March 27, 2025 17:15
Copy link
Copy Markdown
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @asmodehn, I see only 1 failing test in the build:

FAIL: test_device_with_config_change_deactivate_deactivate (openwisp2.sample_config.tests.TestTransactionAdmin)
This test checks the following things
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/home/runner/work/openwisp-controller/openwisp-controller/openwisp_controller/config/tests/test_admin.py", line 2116, in test_device_with_config_change_deactivate_deactivate
    self.assertContains(
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/django/test/testcases.py", line 466, in assertContains
    self.assertEqual(
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 837, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 830, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: 23 != 22 : Found 23 instances of '<div class="readonly">' in response (expected 22)

@nemesifier nemesifier changed the title [change] Add missing sample_config admin tests [tests] Add missing sample_config admin tests Mar 27, 2025
@asmodehn asmodehn force-pushed the add_missing_sample_config_tests branch from 5c688b0 to cdda721 Compare March 28, 2025 08:20
@asmodehn asmodehn marked this pull request as ready for review April 4, 2025 13:18
@asmodehn asmodehn changed the title [tests] Add missing sample_config admin tests [tests] Add missing sample_config admin tests on 1.1 Apr 4, 2025
@nemesifier
Copy link
Copy Markdown
Member

Handled the 1.1 branch manually after merging #996 in 5e1a105, thanks @asmodehn!

@nemesifier nemesifier closed this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants