@@ -2087,44 +2087,49 @@ def test_scanpipe_codebase_resource_queryset_has_directory_content_fingerprint(
20872087
20882088 def test_scanpipe_codebase_resource_queryset_elfs (self ):
20892089 project = Project .objects .create (name = "Test" )
2090- resource_starting_with_elf_and_executable_in_file_type = CodebaseResource . objects . create (
2090+ resource_starting_with_elf_and_executable_in_file_type = CodebaseResource (
20912091 file_type = """ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
20922092 linked, with debug_info, not stripped""" ,
20932093 project = project ,
20942094 path = "a" ,
20952095 type = CodebaseResource .Type .FILE ,
20962096 )
2097- resource_with_executable_in_file_type = CodebaseResource .objects .create (
2097+ resource_starting_with_elf_and_executable_in_file_type .save ()
2098+ resource_with_executable_in_file_type = CodebaseResource (
20982099 file_type = """32-bit LSB executable, ARM, version 1 (ARM), statically
20992100 linked, with debug_info, not stripped""" ,
21002101 project = project ,
21012102 path = "b" ,
21022103 type = CodebaseResource .Type .FILE ,
21032104 )
2104- resource_starting_with_elf_in_file_type = CodebaseResource .objects .create (
2105+ resource_with_executable_in_file_type .save ()
2106+ resource_starting_with_elf_in_file_type = CodebaseResource (
21052107 file_type = """ELF 32-bit LSB resourcable, ARM, version 1 (ARM), statically
21062108 linked, with debug_info, not stripped""" ,
21072109 project = project ,
21082110 path = "c" ,
21092111 type = CodebaseResource .Type .FILE ,
21102112 )
2111- resource = CodebaseResource .objects .create (
2113+ resource_starting_with_elf_in_file_type .save ()
2114+ resource = CodebaseResource (
21122115 file_type = """32-bit LSB relocatable, ARM, version 1 (ARM), statically
21132116 linked, with debug_info, not stripped""" ,
21142117 project = project ,
21152118 path = "d" ,
21162119 type = CodebaseResource .Type .FILE ,
21172120 )
2118- resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource .objects .create (
2121+ resource .save ()
2122+ resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource (
21192123 file_type = """ELF 32-bit LSB relocatable, ARM, version 1 (ARM), statically
21202124 linked, with debug_info, not stripped""" ,
21212125 project = project ,
21222126 path = "e" ,
21232127 type = CodebaseResource .Type .FILE ,
21242128 )
2129+ resource_starting_with_elf_and_relocatable_in_file_type .save ()
21252130 paths = [str (resource .path ) for resource in project .codebaseresources .elfs ()]
2126- assert "e" in paths
2127- assert "a" in paths
2131+ self . assertTrue ( "e" in paths )
2132+ self . assertTrue ( "a" in paths )
21282133
21292134
21302135class ScanPipeModelsTransactionTest (TransactionTestCase ):
0 commit comments