# Buggy code
def initialize(self, identifier):
    self.channel_identifier = identifier
    self.window().manage_channel_create_torrent_back.setIcon(
        QIcon(get_image_path("page_back.png"))
    )
    self.window().seed_after_adding_checkbox.setChecked(True)

    self.window().create_torrent_name_field.setText("")
    self.window().create_torrent_description_field.setText("")
    self.window().create_torrent_files_list.clear()
    self.window().create_torrent_files_list.customContextMenuRequested.connect(
        self.on_right_click_file_item
    )

    self.window().manage_channel_create_torrent_back.clicked.connect(
        self.on_create_torrent_manage_back_clicked
    )
    self.window().create_torrent_choose_files_button.clicked.connect(
        self.on_choose_files_clicked
    )
    self.window().create_torrent_choose_dir_button.clicked.connect(
        self.on_choose_dir_clicked
    )
    self.window().edit_channel_create_torrent_button.clicked.connect(
        self.on_create_clicked
    )


# Traceback (AssertionError)
Tuples differ: (2, ('127.0.0.1', [5, 4, 3, 2,... != (2, ('127.0.0.1', [5, 4, 3, 2,...

First differing element 2:
u'None'
''

- (2, ('127.0.0.1', [5, 4, 3, 2, 1]), u'None')
?                                     - ----

+ (2, ('127.0.0.1', [5, 4, 3, 2, 1]), '')
Stacktrace

Traceback (most recent call last):
File "c:\python27\lib\unittest\case.py", line 329, in run
testMethod()
File "C:\workspace\jenkins\workspace\GH_Tribler_PR_tests_win64\tribler\Tribler\Test\test_as_server.py", line 58, in check
result = fun(*argv, **kwargs)
File "C:\workspace\jenkins\workspace\GH_Tribler_PR_tests_win64\tribler\Tribler\Test\Core\Upgrade\test_config_upgrade_70_71.py", line 33, in test_read_test_libtribler_conf
self.assertEqual(result_config.get_anon_proxy_settings(), (2, ("127.0.0.1", [5, 4, 3, 2, 1]), ''))
File "c:\python27\lib\unittest\case.py", line 513, in assertEqual
assertion_func(first, second, msg=msg)
File "c:\python27\lib\unittest\case.py", line 753, in assertTupleEqual
self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
File "c:\python27\lib\unittest\case.py", line 724, in assertSequenceEqual
self.fail(msg)
File "c:\python27\lib\unittest\case.py", line 410, in fail
raise self.failureException(msg)
AssertionError: Tuples differ: (2, ('127.0.0.1', [5, 4, 3, 2,... != (2, ('127.0.0.1', [5, 4, 3, 2,...

First differing element 2:
u'None'
''

- (2, ('127.0.0.1', [5, 4, 3, 2, 1]), u'None')
?                                     - ----

+ (2, ('127.0.0.1', [5, 4, 3, 2, 1]), '')

# Fixed code
def initialize(self, identifier):
    self.channel_identifier = identifier
    self.window().create_torrent_name_field.setText("")
    self.window().create_torrent_description_field.setText("")
    self.window().create_torrent_files_list.clear()
    self.window().seed_after_adding_checkbox.setChecked(True)
    self.window().edit_channel_create_torrent_progress_label.hide()

    if not self.initialized:
        self.window().manage_channel_create_torrent_back.setIcon(
            QIcon(get_image_path("page_back.png"))
        )

        self.window().create_torrent_files_list.customContextMenuRequested.connect(
            self.on_right_click_file_item
        )
        self.window().manage_channel_create_torrent_back.clicked.connect(
            self.on_create_torrent_manage_back_clicked
        )
        self.window().create_torrent_choose_files_button.clicked.connect(
            self.on_choose_files_clicked
        )
        self.window().create_torrent_choose_dir_button.clicked.connect(
            self.on_choose_dir_clicked
        )
        self.window().edit_channel_create_torrent_button.clicked.connect(
            self.on_create_clicked
        )

        self.initialized = True